Page 2 of 2
Posted: Thu Feb 23, 2006 2:12 pm
by onion2k
determinedmoth wrote:Ok this is interesting. I took an image that has been failing, and saved it as a severly compressed JPG - down to 89kb! This also failed! So the memory limit being the problem could just be a red herring. Maybe it's something to do with the image dimensions.
The filesize of an image is basically meaningless when you're using GD. It decompresses the image data in order to work on the it .. a 1000*1000 image will take up the same amount of RAM whether it's a JPG saved at quality 100 or a JPG saved at quality 30.
Posted: Fri Feb 24, 2006 8:46 am
by determinedmoth
The host has upgraded me to PHP5 (GD - 2.0.28 compatible).
It now works somewhat better, but rather just failing I now get some errors;
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /xxx/xx/xxx/xxxx/xx/admin.php on line 162
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '/xxx/xx/xxx/xxxx/xx/images/lowres/fb6_Picture 078a.jpg' is not a valid JPEG file in /xxx/xx/xxx/xxxx/xx/admin.php on line 162
Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /xxx/xx/xxx/xxxx/xx/admin.php on line 163
Line 162 & 163;
Code: Select all
$image = imagecreatefromjpeg($newfile);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
Posted: Fri Feb 24, 2006 9:01 am
by determinedmoth
Solved I believe!
After trying various options in Photoshop;
You need to resave the jpg (save-as), and at the compression options box, select format as "Baseline ("Standard")".
I yet to have it fail.
Thanks everyone for your help.
*Edit: Removed.
**Edit:
Fix will work for GD v.2.0.28
GD v.2.0 will still fail.
Posted: Fri Feb 24, 2006 9:16 am
by onion2k
determinedmoth wrote:*Edit: Fix only for PHP5! Will still fail on PHP4.
It's a lot more likely to be related to the version of GD than the version of PHP if it's related to the JPEG file layout.
Posted: Fri Feb 24, 2006 9:24 am
by determinedmoth
I agree. I should re-word that.
Fix will work for GD v.2.0.28
GD v.2.0 will still fail.