[File] [PATCH] of Magdir/images for Adobe PC bitmap variants (*.bmp)

Jörg Jenderek joerg.jen.der.ek at gmx.net
Tue Jun 25 16:29:02 UTC 2019


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
some days ago i still found some Adobe PC bitmap variant examples
with file name extension "bmp". Examples are found in BMP Suite
Image List. When i run file command version 5.37 these examples are
only described as "data"

11x11-adobe.bmp:                   data
invalid-compression-BITFIELDS.bmp: data
q-rgb32h52.bmp:                    data
rgba32h56.bmp:                     data

So i add/change lines in Magdir/images. The information about this
variants is found on Wikipedia page about BMP format already
mentioned in magic file.

These Adobe variants have their own dib header size 52 and 56, which
is different from usual Microsoft Windows bitmap sizes.

In the first variant the header use a format named BITMAPV2INFOHEADER.
According to Wikipedia it adds RGB bit masks. This variant is now
recognized by additional lines starting with
 >14	leshort	52	PC bitmap, Adobe Photoshop

Mime type, apple type and file name extension are expressed by lines
 !:mime		image/bmp
 !:apple	????BMPp
 !:ext		bmp
On Wikipedia 3 apple codes 'BMP ', 'BMPf', 'BMPp' are mentioned. I
found no explanation if these are equivalent or are used for
different purposes.
The image dimensions are shown as in Microsoft bitmap variants like
 >>18	lelong		x		\b, %d x
 >>22	lelong		x		%d x
 >>28	leshort		x		%d

In the second variant the header use a format named
BITMAPV3INFOHEADER. According to Wikipedia it also adds alpha
channel bit mask. This variant is now recognized by additional lines
starting with
 >14	leshort	56 PC bitmap, Adobe Photoshop with alpha channel mask
The remaining lines are the same like in first variant.

After applying the above mentioned modifications by patch
file-5.37-images-bmp_adobe.diff then unrecognized Adobe bitmap
variants are now recognized and described like

11x11-adobe.bmp:                   PC bitmap,
	Adobe Photoshop, 11 x 11 x 16
invalid-compression-BITFIELDS.bmp: PC bitmap,
	Adobe Photoshop with alpha channel mask, 2 x 1 x 32
q-rgb32h52.bmp:                    PC bitmap,
	Adobe Photoshop, 127 x 64 x 32
rgba32h56.bmp:                     PC bitmap,
	Adobe Photoshop with alpha channel mask, 127 x 64 x 32

I hope my diff files can be applied in future version of file utility.

There still exist one bitmap variant which is not recognized by file
command. I will handle such things in a future session.

With best wishes
Jörg Jenderek
- --
Jörg Jenderek









-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iFwEARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXRJLxAAKCRCv8rHJQhrU
1tcWAKDexqZ9qrkh9Dubobhs0SCmUSjE6ACYhpXLQzJvUAfAuKwsO408AbzJRA==
=GCwD
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.37/magic/Magdir/images.old	2019-04-19 00:42:27 +0000
+++ file-5.37/magic/Magdir/images	2019-06-25 16:16:48 +0000
@@ -583,2 +583,18 @@
 >>20	leshort		x		%d
+# BITMAPV2INFOHEADER	adds RGB bit masks
+>14	leshort		52		PC bitmap, Adobe Photoshop
+!:mime	image/bmp
+!:apple	????BMPp
+!:ext	bmp
+>>18	lelong		x		\b, %d x
+>>22	lelong		x		%d x
+>>28	leshort		x		%d
+# BITMAPV3INFOHEADER	adds alpha channel bit mask
+>14	leshort		56		PC bitmap, Adobe Photoshop with alpha channel mask
+!:mime	image/bmp
+!:apple	????BMPp
+!:ext	bmp
+>>18	lelong		x		\b, %d x
+>>22	lelong		x		%d x
+>>28	leshort		x		%d
 >14	leshort		40		PC bitmap, Windows 3.x format
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.37-images-bmp_adobe.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20190625/62e3d18a/attachment.obj>


More information about the File mailing list