Page is a not externally linkable
irock - 9:47 am on Jun 1, 2009 (gmt 0)
<?php
Hi after I turned off the registers_globals for my server, my mini image resizing program no longer works. Do you guys know why? Is there a quick fix to this?
Header("Content-type: image/jpeg");
$filenamee = "$_SERVER[DOCUMENT_ROOT]/$filename";
$orig_image = imagecreatefromjpeg($filenamee);
list($width, $height, $type, $attr) = getimagesize($filenamee);
if ($width > $size) {
$ratio = $size / $width;
$newwidth = $size;
$newheight = $ratio * $height; }
if ($width <= $size) {
$newwidth = $width;
$newheight = $height; }
$sm_image = imagecreatetruecolor($newwidth,$newheight) or die ("Cannot Initialize new GD image stream");;
Imagecopyresampled($sm_image,$orig_image,0,0,0,0,$newwidth,$newheight,imagesx($orig_image),imagesy($orig_image));
imageJPEG($sm_image);
imagedestroy($sm_image);
imageDestroy($orig_image);
?>