Menu

#222 cropping gif files causes image data corruption [1.3.16]

v1.0_(example)
closed-invalid
5
2014-03-01
2012-12-20
Dmitry
No

this code
Magick::Image image(\"input.gif\");
Magick::Geometry cropGeom(width, height, xOff, yOff);
image.crop(cropGeom);
image.magick( \"GIF\" );
image.write(\"output.gif\");
causes image metadata corruption: the result image has the correct size, but the picture itself is shifted down and right and has white space on top and left. looks like all the pixels are ok, but the render information is broken, as reproduceability depends on the library to open the processed image - the image is broken in chrome-based browsers, firefox, linux native viewer, while the same file is quite ok in opera, internet explorer, mac os native viewer and windows native viewer. so do you see a normal image or a broken one depends on the robustness of the image decoding library in respect of corrupted data.

the example to reproduce is here - we take the file http://yadi.sk/d/fK-1_aah1Kppe and crop it with geomerty 436-436-0-157 and get this http://yadi.sk/d/rRK2tmy01KptW (the original image file is too big to be uploaded to the issue tracker, the corrupted one is attached as well)

actually there is another bug which is reproducable - even without cropping (just read a gif file and then write it to a new gif file) eliminates animation.

Discussion

  • Dmitry

    Dmitry - 2012-12-20
     
  • Dmitry

    Dmitry - 2012-12-20
    • summary: cropping gif files causes image data corruption --> cropping gif files causes image data corruption [1.3.16]
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2013-10-19

    The links you provided are now broken links. Please attach the input file which causes the problem to this bug report.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2014-03-01

    Image download links provided are broken. We have not observed such problems here and have not received other similar bug reports. The geometry specification provided does not use the correct syntax.

    In order to preserve GIF animation, it is necessary to use the STL-based reading/writing routines. The plain Image read/write routines only deal with one frame.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2014-03-01
    • status: open --> closed-invalid
    • Group: --> v1.0_(example)
     

Log in to post a comment.

MongoDB Logo MongoDB