Duplicate WMF import extension, one of them is broken

Bug #552351 reported by Aldo Cavini benedetti on 2010-03-31
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Alvin Penner

Bug Description

I'm using Autocad LT98 to create some 3d diagrams, and export to WMF to mantain the viewing perspective. On importing such WMF into Inkscape, the object IDs are tagged as numerical, so the SVG file is invalid as reported by the W3 Markup Validation Service. The workaround is to change the object IDs by hand... not impossible to do, but a little boring! Could Inkscape check for those IDs and rename them on loading the WMF file?

I'm using Inkscape 0.47 on Windows XP

su_v (suv-lp) on 2010-03-31
tags: added: importing wmf
Alvin Penner (apenner) wrote :

- could you attach the .wmf file?

- also, somewhat OT, have you tried to use .dxf to do this transfer?

I tried with dxf too. I get correctly assigned IDs - the problem is dxf doesn't save the point of view.

The attached file is a wmf: It get the perspective, but the object IDs are not correctly assigned.

Alvin Penner (apenner) wrote :

confirmed, but it is not exactly clear whose responsibility this is, since the file conversion is actually performed by uniconvertor, not Inkscape. The behaviour of Inkscape with respect to object id's is that, if the incoming object has a unique id then Inkscape will accept it as is. If it has no id then Inkscape will create an id which will always begin with a letter, such as 'g' for goup or 'rect' for rectangle.
    There is a workaround. Convert from .wmf to .svg using uniconvertor offline using the command:
\python26\scripts\uniconv t2.wmf t2.svg
The resulting file is attached. It passes the validation test with one warning. The stroke width is extremely small, so you may have to increase the stroke width to see the object.

Thanks for the reply... the problem is I can't find such uniconv! (no problem, at the moment I'm changing IDs by hand)

Anyway, may be Inkscape could check for correct IDs on each import...

Alvin Penner (apenner) wrote :

sorry, I misspoke myself. The problem is that there are two version of .wmf input on Windows. (I'm assuming you are using Windows, since you are using AutoCAD)

- there is an import file type called 'Windows Metafiles', this is a native Inkscape import which exhibits this problem with id's. This is the default method, so if you right-click on a .wmf file and open it with Inkscape, this is the one you will get.

- there is also a second import file type called 'Windows Metafile', which uses a Python extension called uniconvertor, and this method does not exhibit this problem, even when you call it from inside Inkscape.

could you check to see if this second method exists on your menu?

Well, actually there are two identical items about wmf in my import menu. The first one shows the IDs import error, while the second one runs correctly. With this I think all my import problems are solved... thanks very much!

Alvin Penner (apenner) wrote :

good to hear, any objections if I mark this as Fix Released?

Thats ok for me! Simply I suggest to declare this workaround in the FAQs or somewhere else...

Alvin Penner (apenner) on 2010-04-02
Changed in inkscape:
status: New → Fix Released
Krzysztof Kosinski (tweenk) wrote :

The broken option should be disabled before this can be marked as fixed.

Changed in inkscape:
status: Fix Released → Confirmed
summary: - Import from WMF
+ Duplicate WMF import extension, one of them is broken
tags: added: win32
removed: wmf
Krzysztof Kosinski (tweenk) wrote :

I recall the "native" WMF import (the one that causes troubles) only works on Windows.

Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.48
jazzynico (jazzynico) on 2010-07-15
Changed in inkscape:
milestone: 0.48 → 0.49
Alvin Penner (apenner) wrote :

the emf import routine, which incidentally also contains support for the Windows Metafiles (wmf) import (Windows specific), has been modified so that it no longer writes numerical id's to the svg file. This allows Inkscape to assign its own default ids which consist of some text followed by some numerical info. The result is attached.

committed to bzr rev 10083

Changed in inkscape:
status: Confirmed → Fix Committed
su_v (suv-lp) on 2011-03-08
Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
su_v (suv-lp) wrote :

Backported to the 0.48.x branch in revision 9803 (milestone 0.48.2).

Changed in inkscape:
milestone: 0.49 → 0.48.2
Ted Gould (ted) on 2011-09-07
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers