We are on PHP 4.0.5
GD 1.62 and above.
The following is generating an error at the line involving ImageCopyResized().
ERROR: "Warning: Supplied argument is not a valid Image resource"
$file is the file uploaded from a form.
<?
$new_w = 100;
$image_size = GetImageSize($file);
list($foo,$image_width,$bar,$image_height) = explode("\"",$image_size[3]);
$reduce_scale = $image_width/$new_w;
$new_h = $image_height/$reduce_scale;
echo $new_h;
echo "image width:" . "$image_width" . "<br>";
echo "image height:" . "$image_height" . "<br>";
echo "File :" . "$file" . "<br>";
$large_image = imagecreatefromjpeg($file); // This is the image to be resized
echo "large_image :" . "$large_image" . "<br>";
$small_image = imagecreate($new_w,$new_h); // This is a memory allocation for the new image
echo "Small_image :" . "$small_image" . "<br>";
imagecopyresized($small_image,$lage_image, 0, 0, 0, 0,$new_w,$new_h,$image_width,$image_height); // Copy the source image file into the new image memory and resize
Imagejpeg($large_image,'/home/shelly/public_html/testing/image_large_01.jpg',50);
ImageDestroy($large_image);
imagejpeg($small_image,'/home/shelly/public_html/testing/image_small_01.jpg',50);
?>