[File] [PATCH] of Magdir/images for ImageMagick MIFF image

Christos Zoulas christos at zoulas.com
Sat Nov 23 16:20:11 UTC 2019


Applied, thanks!

christos

> On Nov 21, 2019, at 9:41 AM, Jörg Jenderek <joerg.jen.der.ek at gmx.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> some days ago i had to handle some ImageMagick bitmaps which have
> normally filename extension miff. When searching on my systems for
> such files and similar test files and runnig file command version
> 5.37 i get unexpected output like:
> 
> AQUARIUM.MIF:    data
> DNA.MIF:         MIFF image data
> smile_anim.miff: data
> TEST3-NAME.txt:  data
> TEST-NAME.txt:   MIFF image data
> 
> Furthermore with -i option only application/octet-stream is shown and
> with --extension only ??? is displayed.
> 
> First i add to Magdir/images comment with URL at ImageMagick site
> about MIFF format by line:
> # URL:		https://imagemagick.org/script/miff.php
> 
> According to that site MIFF files should start with keyword-value
> combination id=ImageMagick. So first variant examples are detected by
> magic line  in Magdir/images
> 0	string		id=ImageMagick	MIFF image data
> A more precise identification for MIFF can be found on file formats
> archive team web site. So i add this as reference by comment line:
> # Reference:	http://fileformats.archiveteam.org/wiki/MIFF
> 
> Furthermore there exist also examples like AQUARIUM.MIF in the
> Encyclopedia of Graphic File Formats, where this phrase does not
> appear at the beginning but later. Such examples usually start with
> a comment that is introduced in this file format by a curly brace.
> This variant is not detected by above current magic line.
> 
> For comparison reason i run other utilities.
> The droid tool { found at http://droid.sourceforge.net/ } recognize
> this variant described by PUID fmt/930.
> The file identifier tool TrID  (see http://mark0.net/soft-trid-e.html)
> describes the second variant examples correctly as "ImageMagick
> Machine independent File Format bitmap (with rem)" by definition
> bitmap-miff-rem.trid.xml.
> 
> Third variant are for examples in which this combination appears in
> a different capitalization, such as "Id=ImageMagick". Such example lik
> e
> smile_anim.miff can be found in the demo subdirectory of ImageMagick
> source version 7.0.9-2. This variant is only recognized by newest
> TrID definition bitmap-miff.trid.xml.
> 
> To catch keyword with different up-/downcase spelling and at
> different offsets, first magic line now becomes:
> 0	search/256/bc	id=imagemagick
> 
> Maybe now test condition is too relaxed. To skip bad ASCII text with
> that keywords combination look for following next character. In real
> MIFF images this character is space or new line. So test for that
> character by second magic line
>> &0	ubyte&0xD5	0		MIFF image data
> 
> Some sites on the net use mime type image/miff, but i found no such
> official registered type at IANA. So i choose a user defined by line:
> !:mime	image/x-miff
> Beside file name extension miff also mif can be found. This is now
> shown by line:
> !:ext	miff/mif
> 
> After identifying MIFF images afterward show more information for
> examples with unusual file(1) magic by line
>>> 0	string		!id=ImageMagick	starting with
> Second variant starting with comment (curly brace "{") are handled by
> branch with lines:
>>>> 0	ubyte		=0x7b		comment
>>>>> 2	string		x		"%s"
> Third and remaining variant with letters with other case are done by
> branch with lines:
>>>> 0	ubyte		!0x7b
>>>>> 0	string		>\0		'%-.14s'
> 
> After applying the above mentioned modifications by patch
> file-5.37-images-miff.diff then i get a describing output like
> 
> AQUARIUM.MIF:    MIFF image data starting with comment
> 	"  Imported from MTV raster image:  aquarium.mtv"
> DNA.MIF:         MIFF image data
> smile_anim.miff: MIFF image data starting with 'Id=ImageMagick'
> TEST3-NAME.txt:  data
> TEST-NAME.txt:   data
> 
> I hope my diff file can be applied in future version of
> file utility.
> 
> With best wishes
> Jörg Jenderek
> - --
> Jörg Jenderek
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> 
> iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXdah8gAKCRCv8rHJQhrU
> 1iJKAKDBU2nk0jy96U+/JGZ/xihhixKjAwCeNAE2k4Paq6wNM8YdCHgp876ddFI=
> =X5T2
> -----END PGP SIGNATURE-----
> <file-5_37-images-miff_diff.DEFANGED-13><file-5_37-images-miff_diff_sig.DEFANGED-14>-- 
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>



More information about the File mailing list