Forum Moderators: coopster

Message Too Old, No Replies

Is this an emerging problem?

JPEG errors on the rise

         

gsbatch

8:00 pm on Jan 23, 2008 (gmt 0)

10+ Year Member



My image upload routine uses the imagecopyresampled function to create thumbnails. For months it worked without a single error. Now, over the past several months, imagecopyresampled has beed producing "not a valid resource" errors (jpeg). It is getting worse month-by-month.

If I simply open the images in photoshop or photopaint and resave they upload fine. The one common element is that they are all generated by digital cameras. I'm wondering if they are starting to use a different subformat, compression, extended Exif data or the like that GD library can't handle.

Has anyone else been experiencing the same? Am I overlooking something else? Does ImageMagick do a better job than GD? If so, is ImageMagick installed on enough hosts to safely use it in a distributed script?

Thanks!

yannis

8:51 pm on Jan 23, 2008 (gmt 0)

10+ Year Member



These errors happen when the image has not been fully uploaded. Although photoshop and other programs including browser rendering engines will still show it (but it probably has a chunk of the bottom chopped off).

When you resave the image the graphics programs will normally correct the format properly.

IMagck is better in many respects but you need PHP5 and most hosts at this stage are still lagging behind.

gsbatch

9:35 pm on Jan 23, 2008 (gmt 0)

10+ Year Member



Well, my fist thought was that the image upload was failing for some reason - timeout, temp error, etc., but the full size image is uploaded completely and displays fine. The issue seems to be only with processing the thumbnail.

pixeline

10:25 pm on Jan 23, 2008 (gmt 0)

10+ Year Member



for all image upload needs, i strongly advise to use verot's awesome file upload class:

<snip>

And yes, imagemagick does a better job than GD. But it is not installed on many servers, whereas GD is bundled as a module in most recent PHP releases.

[edited by: dreamcatcher at 7:06 pm (utc) on Jan. 24, 2008]
[edit reason] no urls as per T.O.S [webmasterworld.com].Thanks [/edit]