Semi-Corrupt JPEG problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dirving
Posts: 13
Joined: 2008-08-28T13:45:14-07:00

Semi-Corrupt JPEG problem

Post by dirving »

Hi everyone,

I have some code that I've written in C using the MagickWand API. The code does some basic operations on my input images, resizing, resampling, changing the colorspace if necessary, etc, etc. The problem that I have is that the output JPEG file seems to be corrupt in some manner. Linux, OS X, and Windows can open and manipulate the file, FireFox 3, and Safari also have no issue. The problem comes in with FireFox 2 and IE6 & IE7. Neither of these browsers are able to load the file. I don't believe the code is to blame since if I change the output to a GIF file, all browsers and OS'es can load it just fine. Any ideas? I'm not that knowledgeable when it comes to the inner-format of graphics files so I'm hoping someone can help me out. Here is one of the "corrupt" output files:

http://wbd.wbdhost.com/3383.jpeg

Much Thanks,
David
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Semi-Corrupt JPEG problem

Post by magick »

Many browser cannot handle JPEG images that are in the CMYK colorspace such as yours or if they are progressively encoded. Use this command to inspect your image

identify -verbose 3383.jpeg

and use profiles to convert your image from CMYK to RGB and set the image interlace to NoInterlace to prevent progressive encoding.
Post Reply