Author Topic: updated mvg.trid.xml for Magick Vector Graphics (*.mvg) with other white space  (Read 1538 times)

jenderek

  • Sr. Member
  • ****
  • Posts: 361
Hello trid users,

some weeks ago i had to handle some ImageMagick bitmaps. Then i also look
for other Magick formats like Magick Vector Graphics ( *.mvg) described by
mvg.trid.xml. When running trid on such files some like file_move.mvg
and more test examples these are not recognized (See appended
output/trid-old.txt).

The recognition happens by global pattern via XML construct
   <Bytes>7075736820677261706869632D636F6E746578740A20</Bytes>
   <ASCII> p u s h   g r a p h i c - c o n t e x t</ASCII>
   <Pos>0</Pos>

This matches many examples like piechart.mvg where second line is intended
like:
push graphic-context
  viewbox 0 0 624 369

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.

Now i run tridscan to update definition file. Now pattern becomes
   <Bytes>70757368</Bytes>
   <ASCII> p u s h</ASCII>
   <Pos>0</Pos>
And the other relevant keywords now occur in global string section by lines:
   <String>PUSH GRAPHIC-CONTEXT</String>
   <String>VIEWBOX</String>

With the new trid definition all MVG examples are now described ( see
appended output/trid-new-v.txt). TrID definition, some examples and output
are stored in archive mvg.zip. I hope that my updated XML file can be used
in future version of triddefs.

With best wishes
Jörg Jenderek

# LocalWords:  ImageMagick mif RefURL tridscan Pos trid TrID triddefs Jörg
# LocalWords:  Jenderek sourceforge IANA Magick mvg piechart viewbox

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2667
    • Mark0's Home Page
Thanks for the update!