[File] [PATCH] of Magdir/images for ImageMagick Vector Graphic *.mvg

Christos Zoulas christos at zoulas.com
Sat Jan 11 16:36:29 UTC 2020


Committed, thanks!

christos

> On Jan 5, 2020, at 4:41 PM, Jörg Jenderek <joerg.jen.der.ek at gmx.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> some weeks ago i had to handle some ImageMagick bitmaps. Then i
> also look for other Magick formats like Magick Vector Graphics (
> *.mvg).
> 
> When running file command version 5.38 on such examples and some
> test samples these are described as text with mime type text/plain.
> More annoying is that dangerous examples like
> exploit-CVE-2016-3715.jpg.mvg are described as simple text files.
> 
> For comparison reason i run other utilities.
> The file identifier tool TrID  (see
> http://mark0.net/soft-trid-e.html) describes such MVG examples
> correctly as "Magick Vector Graphics" by definition mvg.trid.xml.
> 
> On ImageMagick web site this format is described. For that fact i
> add to Magdir/images a comment line like:
> # Ref.:	https://imagemagick.org/script/magick-vector-graphics.php
> 
> Many examples like piechart.mvg looks like:
> push graphic-context
> viewbox 0 0 624 369
> 
> Normally second lines is intended. The first sample i found that
> does not obey this description was file_move.mvg. There second line
> was not intended and lines look like:
> push graphic-context
> viewbox 0 0 640 480
> 
> Then i read information mentioned by reference URL. There it is
> written that MVG ignores all white-space between commands. So i
> modified piechart.mvg after "push" phrase. Instead space character
> a tabulator character or a carriage return character or more white
> spaces are used. Yes indeed all these variants like
> piechart-tabSpace.mvg are valid MVG and are shown by ImageMagick
> display command.
> So i first look for starting keyword by line
> 0	string		push
> Next i skip some white spaces and look for next characteristic
> words by line
>> 5	search/3	graphic-context	ImageMagick Vector Graphic
> Instead text/plain as mime type i display a user defined one by line
> !:mime	image/x-mvg
> The file name extension for ImageMagick Vector Graphic is shown by
> line
> !:ext	mvg
> 
> After applying the above mentioned modifications by patch
> file-5.38-images-mvg.diff then i get an output like:
> 
> exploit-CVE-2016-3715.jpg.mvg: ImageMagick Vector Graphic
> file_move.mvg:                 ImageMagick Vector Graphic
> piechart-2.mvg:                ImageMagick Vector Graphic
> piechart-NL.mvg:               ImageMagick Vector Graphic
> piechart-tab.mvg:              ImageMagick Vector Graphic
> piechart-tabSpace.mvg:         ImageMagick Vector Graphic
> piechart.mvg:                  ImageMagick Vector Graphic
> x.gif.mvg:                     ImageMagick Vector Graphic
> piechart-bad.txt:              ASCII text
> 
> 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+v8rHJQhrU1gUCXhJX+gAKCRCv8rHJQhrU
> 1vBsAJ4l0hCr0OMhPl+PNjzyqcEASSDigQCglFMY5Xsfwe2Gp/SN/PjqKXojSlU=
> =KXmV
> -----END PGP SIGNATURE-----
> <file-5_38-images-mvg_diff.DEFANGED-6116><file-5_38-images-mvg_diff_sig.DEFANGED-6117>--
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20200111/49708a71/attachment.asc>


More information about the File mailing list