Forum Moderators: coopster
I believe that the corruption has to be taking place either when the image is downloaded or when imagick imports the image object, since all three sizes are corrupt and look identical (I assume that if the corruption was happening in the imagick transform, maybe one of the three images would be corrupt, or at least they'd be corrupt in different ways).
Is there a way to test whether a downloaded JPG is valid and complete? or is anyone aware of error checking within imagick itself that could check the image?
Thanks for any ideas.
The identify program describes the format and characteristics of one or more image files. It also reports if an image is incomplete or corrupt.
If you can get the image's attributes it should be fine - however, most of this data is stored in the image header, if the data following that is corrupt, it may not work.
There may be other command line utilities on ImageMagick.org that will do the same thing, but may have the same problem if it doesn't work.
Note that iMagick is the PHP interface to ImageMagick, so most of the command line utilities you will find there can be accessed by PHP (or any other language with an ImageMagick interface.) Your server's ImageMagick may or may not have all the libraries installed to access all features, you can see what's installed by pulling a phpinfo().
As for the cause of the corruption, it's hard to say, but something is amiss on the server, I've rarely had corruption issues with ImageMagick. The ones I have had have to do with unsupported formats- that is, a particular .jpg format that has some algorithm not supported by ImageMagick for some undetermined reason. Perhaps examine just these images, are the originals saved the same way as good ones?