Menu

#18 gm identify: Corrupt image [Bad file descriptor].

v1.0_(example)
closed
None
5
2016-04-23
2014-10-09
liushaog
No

how to fix corrupt image?

photo file
http://www.designboom.cn/wp-content/uploads/2014/10/six-monkeys-for-mailchimp-physical-interactions-with-email-designboom-01.gif

command: gm identify 01.gif

debug all log

10:17:01 0:01 0.000u 62599 log.c/SetLogEventMask/1079/Configure:
Set log event mask: all
10:17:01 0:01 0.000u 62599 module.c/OpenModule/1447/Configure:
Searching for module "GIF" using file name "gif.la"
10:17:01 0:01 0.000u 62599 module.c/FindMagickModule/672/Configure:
Searching for coder module file "gif.la" ...
10:17:01 0:01 0.000u 62599 module.c/FindMagickModule/706/Configure:
Searching for module file "gif.la" in path "/usr/local/lib/GraphicsMagick-1.3.20/modules-Q8/coders/"
10:17:01 0:01 0.000u 62599 utility.c/IsAccessible/2912/Configure:
Found: /usr/local/lib/GraphicsMagick-1.3.20/modules-Q8/coders/gif.la
10:17:01 0:01 0.000u 62599 module.c/OpenModule/1469/Configure:
Opening module at path "/usr/local/lib/GraphicsMagick-1.3.20/modules-Q8/coders/gif.la" ...
10:17:01 0:01 0.000u 62599 module.c/OpenModule/1505/Configure:
Function "RegisterGIFImage" in module "GIF" at address 0x10fc0a760
10:17:01 0:01 0.000u 62599 module.c/OpenModule/1522/Configure:
Function "UnregisterGIFImage" in module "GIF" at address 0x10fc0a810
10:17:01 0:01 0.000u 62599 blob.c/OpenBlob/2440/Blob:
Opening Blob for image 0x7fc2f1825c00 using ReadBinary mode ...
10:17:01 0:01 0.000u 62599 blob.c/OpenBlob/2625/Blob:
I/O buffer set to 16384 bytes
10:17:01 0:01 0.000u 62599 blob.c/OpenBlob/2647/Blob:
opened file "01.gif" as FileStream blob 0x7fc2f1827698
10:17:01 0:01 0.000u 62599 blob.c/OpenBlob/2662/Blob:
read 4214809 magic header bytes
10:17:01 0:01 0.000u 62599 blob.c/CloseBlob/833/Blob:
Closing FileStream blob 0x7fc2f1827698
10:17:01 0:01 0.000u 62599 pixel_cache.c/DestroyCacheInfo/1741/Cache:
destroy cache
10:17:01 0:01 0.000u 62599 blob.c/DestroyBlob/969/Blob:
Destroy blob, image=0x7fc2f1825c00, filename="01.gif"
10:17:01 0:01 0.000u 62599 constitute.c/ReadImage/1478/Blob:
Magick=GIF, Filename=01.gif
10:17:01 0:01 0.000u 62599 constitute.c/ReadImage/1594/Coder:
Invoking "GIF" decoder (CompuServe graphics interchange format) subimage=0 subrange=0
10:17:01 0:01 0.000u 62599 blob.c/OpenBlob/2440/Blob:
Opening Blob for image 0x7fc2f1825c00 using ReadBinary mode ...
10:17:01 0:01 0.000u 62599 blob.c/OpenBlob/2625/Blob:
I/O buffer set to 16384 bytes
10:17:01 0:01 0.000u 62599 blob.c/OpenBlob/2647/Blob:
opened file "01.gif" as FileStream blob 0x7fc2f1827698
10:17:01 0:01 0.000u 62599 blob.c/OpenBlob/2662/Blob:
read 4214809 magic header bytes
10:17:01 0:01 0.000u 62599 gif.c/ReadGIFImage/956/Coder:
Loop extension with iterations 0
10:17:01 0:01 0.000u 62599 gif.c/DecodeImage/282/Coder:
Excessive LZW string data (string table overflow)
10:17:01 0:01 0.000u 62599 gif.c/DecodeImage/381/CorruptImage:
Corrupt image (01.gif)
10:17:01 0:01 0.000u 62599 blob.c/DestroyBlob/969/Blob:
Destroy blob, image=0x7fc2f182fc00, filename="01.gif"
10:17:01 0:01 0.000u 62599 gif.c/DecodeImage/145/CorruptImage:
Corrupt image (01.gif)
10:17:01 0:01 0.000u 62599 blob.c/CloseBlob/833/Blob:
Closing FileStream blob 0x7fc2f1827698
10:17:01 0:01 0.000u 62599 constitute.c/ReadImage/1605/Coder:
Returned from "GIF" decoder: cache=present monochrome=False grayscale=False class=PseudoClass colorspace=RGB
10:17:01 0:01 0.000u 62599 pixel_cache.c/DestroyCacheInfo/1741/Cache:
destroy cache 01.gif[0]
10:17:01 0:01 0.000u 62599 blob.c/DestroyBlob/969/Blob:
Destroy blob, image=0x7fc2f1825c00, filename="01.gif"
10:17:01 0:01 0.000u 62599 pixel_cache.c/DestroyCacheInfo/1741/Cache:
destroy cache
10:17:01 0:01 0.000u 62599 blob.c/DestroyBlob/969/Blob:
Destroy blob, image=0x7fc2f182fc00, filename="01.gif"
gm identify: Corrupt image (01.gif) [Bad file descriptor].
10:17:01 0:01 0.000u 62599 command.c/IdentifyImageCommand/8623/Option:
Request did not return an image
gm identify: Request did not return an image.
10:17:01 0:01 0.000u 62599 magick.c/DestroyMagick/169/Configure:
Destroy Magick
10:17:01 0:01 0.000u 62599 module.c/UnloadModule/2180/Configure:
Unloading "GIF" module ...

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2014-10-10

    We have seen a number of such reports. The main thing in common with the files which encounter this error is that the GIF files are very large (e.g. several megabytes). Perhaps there is a bug in GraphicsMagick or the encoder which writing the files has a bug. It is also possible that the files were intentionally corrupted since LZW table overflow has been a known virus exploit in the past.

    I do notice that if I use ImageMagick's convert to 'convert' this GIF to another file that GraphicsMagick is then able to read the result without any problem. This suggests that the issue is not directly to do with file size.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-04-23
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-04-23

    Several bug reports are open regarding GIF reader failure for very large animated GIF files. Closing now since this will be treated as a bug.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-04-23
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-04-23
    • status: open --> closed
     

Log in to post a comment.