ImageMagick (6.6.1-10) seems unable to convert certain BMP files, giving the error "insufficient image data in file [...] @ error/bmp.c/ReadBMPImage/869"
The images are screenshots from the game Baldur's Gate II. If one of the troublesome BMPs is converted into another format by another program and back into BMP, ImageMagick can convert it. I assume there's something wonky, or non-standard, or whatever about these files. Is there anything that can be done about it?
I've added 3 files to a zip archive and made it available here.
Unable to convert certain bmps
Re: Unable to convert certain bmps
We can reproduce the problem you posted and have a patch in ImageMagick 6.6.2-0 Beta available by sometime tomorrow. Thanks.
Re: Unable to convert certain bmps
I have a similar problem. Bitmap is there: http://www.sendspace.com/file/korkhv
With version 6.6.7-7 (sources):
With version 6.6.7-7 (sources):
With version 6.6.2-6 (ubuntu):$ convert in.bmp -resize 185x163 out.jpg
convert: insufficient image data in file `in.bmp' @ error/bmp.c/ReadBMPImage/918.
convert: missing an image filename `out.jpg' @ error/convert.c/ConvertImageCommand/2959.
$ convert -version
Version: ImageMagick 6.6.7-7 2011-02-18 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features:
$ convert -resize 185x163 in.bmp out.jpg
convert: insufficient image data in file `in.bmp' @ error/bmp.c/ReadBMPImage/913.
convert: missing an image filename `out.jpg' @ error/convert.c/ConvertImageCommand/2970.
$ convert -version
Version: ImageMagick 6.6.2-6 2010-12-02 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
Re: Unable to convert certain bmps
You bitmap is corrupt. For security reasons, ImageMagick will not decode a corrupt image. To confirm we used the bmptopnm utility and it returns:
- -> bmptopnm out.bmp
bmptopnm: Windows BMP, 1680x1050x32
bmptopnm: warning: the BMP header says the raster starts at offset 58 bytes into the file (offbits), but that there are 54 bytes of information before the raster. This inconsistency probably means the input file is not a legal BMP file and is unusable.
bmptopnm: End of file reading row 0 of BMP raster.