Problems with imagejpeg
| From: | René Fournier | Date: | Sat, 27 Dec 2003 07:07:12 +0000 |
| Subject: | Problems with imagejpeg | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-173357@lists.php.net to get a copy of this message | ||
I have a function that [is meant to] check if an image is greater than a certain width and height, and if it is, downsample it. The checking part works fine. Downsampling is happening though. Here's what I've got ($file = "/somedirectory/photo.jpg"):
$src_img=imagecreatefromJPEG($file);
$dst_img=imagecreatetruecolor($new_width,$new_height);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_width,$new_height,$size[0],$size[1]);
imagejpeg($dst_img,$file,$img_quality);
Any ideas?
Thanks.
...Rene