Skip to content

Draft: CGM Input

Jonathan Neuhauser requested to merge joneuhauser/extensions:cgm-input into master

What does the merge request do?

Adds a CGM importer. This was previously covered by UniConvertor.

CGM is a somewhat historic file format - all test files I found online are from the last millenial - but still somewhat interesting because it's an ISO standard. It's a matter of digital preservation, there are very few tools available to read these files and at best they have a half-broken PostScript export.

Implementation notes

With the parser, I aimed to support as much as necessary (and supporting more is difficult because there are no programs available to generate test files!). Most files work with a very small subset of commands. Hence, Markers, Patterns / Hatches, NURBS, CMYK and other obscure stuff was not added.

I tried out a new approach for the parser that heavily relies on typing and introspection to write readable and boilerplate-light code. Worked fine for me. (The entire project took about a week.)

Main problem here is test coverage. I don't have any test files that have a license attached (or even look like they might have an open license). The companies that created them don't exist anymore. I might extract small snippets of those to generate unit tests.

Summary for release notes

Add an importer for CGM (Computer Graphics Metafile) again, which was removed with Inkscape 1.0.

Checklist

  • Add unit tests (if applicable)
  • Changes to inkex/ are well documented
  • Clean merge request history
Edited by Jonathan Neuhauser

Merge request reports