OS/2 BMP variant with 16 byte DIB header not handled by ImageMagick

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Locked
j2j
Posts: 2
Joined: 2019-11-13T16:13:36-07:00
Authentication code: 1152

OS/2 BMP variant with 16 byte DIB header not handled by ImageMagick

Post by j2j »

some days ago i handle some OS/2 BMP variant. An example of such a case
is the graphic pal8os2v2-16.bmp of Jason Summers BMP test Suite.

When i run identify command version 7.0.8-49 on Linux and 7.0.9-2 on
Windows all of these examples are only described as:

identify: non OS2 BMP header size less than 40 `pal8os2v2-16.bmp' @ error/bmp.c/ReadBMPImage/657.
identify: non OS2 BMP header size less than 40 `TEAMcol-12.bmp' @ error/bmp.c/ReadBMPImage/657.

Also many popular graphic tools like GIMP, ImageMagick or XnView can
open the Microsoft BMP variant, but are not able to open that OS/2
bitmap variant. Surprisingly the Firefox web browser can open such
bitmaps. Also the Windows graphic tool IrfanView can handle such
bitmaps.

The information about this variants is found on Wikipedia page about
BMP format. See https://en.wikipedia.org/wiki/BMP_file_format

According to Wikipedia the DIB header use a format named
OS22XBITMAPHEADER. This format stores only the first 16 byte of the
OS/2 variant with 64 bytes. The remaining 48 bytes are assumed to be
zero values.

I hope that this OS/2 variant will be implemented in a future version
of ImageMagick tools. This should not be so difficult, because other
BMP variants are recognized.

Thanks!

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: OS/2 BMP variant with 16 byte DIB header not handled by ImageMagick

Post by magick »

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

Locked