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.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.
[Solved] GD Library issues with file size.
Moderator: General Moderators
-
determinedmoth
- Forum Commoner
- Posts: 33
- Joined: Wed Jul 07, 2004 9:13 am
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;
It now works somewhat better, but rather just failing I now get some errors;
Line 162 & 163;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
Code: Select all
$image = imagecreatefromjpeg($newfile);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);-
determinedmoth
- Forum Commoner
- Posts: 33
- Joined: Wed Jul 07, 2004 9:13 am
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.
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.
Last edited by determinedmoth on Fri Feb 24, 2006 9:25 am, edited 1 time in total.
-
determinedmoth
- Forum Commoner
- Posts: 33
- Joined: Wed Jul 07, 2004 9:13 am