What's wrong about this image?

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
lichtin

What's wrong about this image?

Post by lichtin »

Hi,
"display" says it's a corrupt image.

http://inl-images.adbureau.net/inl/acci ... es/AE0.gif

What's wrong about it?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: What's wrong about this image?

Post by magick »

It appears that the LZW compression is corrupt or encoded incorrectly. We tried a number of image readers and more than half choked on the image and yet a few converted or displayed the image without complaint.
lichtin

Re: What's wrong about this image?

Post by lichtin »

Ok.
So we made a change which seems to fix the issue:

Code: Select all

      switch (pass)
      {
        case 0:
        default:
        {
          offset+=8;
          if (offset >= (long) image->rows)
            {
              pass++;
              offset=4;

              /* interlaced gif does not work with only 3 rows */
              if (offset >= (long) image->rows) {
                  /* skip pass 1 */
                  pass++;
                  offset=2;
              }
              if (offset >= (long) image->rows) {
                  /* skip pass 2 */
                  pass++;
                  offset=1;
              }
            }
          break;
        }
Post Reply