wmf import problems (wrong colors, transparency)

Bug #166782 reported by Davespagnol on 2005-07-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

I have literally thousands of *.wmf files from my
Windows days. Given that inkscape has just been updated
to 0.42, I thought I would try to see if it could cope
with them. On selecting one in the File Open or File
Import dialogue, it displayed correctly in the preview,
but it still loaded wrongly, silhouetted or darkened,
as if the layers were not in the right order.

Clearly, if it can display correctly in the file
selection dialogue, something is working correctly,
what puzzles me is why it cannot go on to open/import
the files correctly. I tried a load of different *.wmf
files, all with much the same result!

Can you please attach here some of the files that were
wrongly imported?

Davespagnol (davespagnol) wrote :

Carrots and Apple import as transparent.

Alligatr and Bear come out almost black.

Yet all of them preview perfectly in the Open dialogue, and
open correctly in OpenOffice Draw.

Prokoudine (prokoudine) wrote :

I have lots of WMFs on my Windows partition from MS Office
2003 clipart. All of them load to Inkscape and are displayed
exactly the way they are supposed to. But all of the images
consist of polygons which cannot be edited. I mean: you can
easily rotate or skew them, but you cannot edit nodes.

Ulferikson (ulferikson) wrote :

If you are on Windows and able to compile Inkscape from
sources you can try my patch for importing Wmf files:

Please note that it is actually an Emf exporter able to read
back written files. Importing regular Emf and Wmf files is
not the main goal, but works in some cases.

The four attached examples work okay for me with one issue:
Wmf files often contain lines that should be rendered as one
pixel wide independent of zoom level (i'm not sure if SVG
can model that, but i guess i should try to get the
"correct" width at normal zoom).

About editing Wmf's: There is no stroke-and-fill in Wmf; You
have filled polygons and stroked polylines; plus Wmf files
only contain straight lines and circular arcs (but the arcs
are hardly ever used) with a lot of nodes. This makes Wmf
files very hard to edit.

Let me know whether you are able to test the patch, and what
your results are.

Davespagnol (davespagnol) wrote :

I am still having the same problem. I am using Linux.
PCLinuxOS with version 0.44 and libwmf

Clearly from what others have said, SOME wmf files open OK.
I still find it weird that the files I have preview OK, but
open wrongly. Also that they open perfectly in

Bug Importer (bug-importer) wrote :

The preview image is handled by Gdk pixbuf with libwmf as
renderer. Libwmf parses the file and builds up a pixelized
image by executing Wmf commands.

The translation from Wmf to Svg is also handled by libwmf,
but this time Wmf commands are translated into similar Svg
commands. Inkscape will read the Svg file and render it.

While you use the same parser in both cases you must not
forget that you use two different back-ends; one that
operates on pixels and one that operates on vector objects.
There might be bugs or short-commings in one back-end that
don't exist in the other.

vonHalenbach (lustik) wrote :

The file seems to be damaged. Maybe it is the cause of the ugly import into inkscape? I can't test it without some wmf files, so i set this bug to incomplete.

Changed in inkscape:
status: New → Incomplete
Tom Davidson (tjd-mit) wrote :
Tom Davidson (tjd-mit) wrote :
Tom Davidson (tjd-mit) wrote :
Tom Davidson (tjd-mit) wrote :
Tom Davidson (tjd-mit) wrote :
Tom Davidson (tjd-mit) wrote :
Tom Davidson (tjd-mit) wrote :

I think the issue of the preview being different has been resolved (preview only requires a rasterization, import requires conversion to SVG), but the bad import remains. I was able to unpack the tar, and posted the files singly. I also opened them in eog (eye of gnome) and saved them out as pngs, which I've attached here, as references. As Davespagnol reported, there are some odd transparency and color changes in Inkscape import...

I'm using today's SVN (rev 17236) under Linux (Fedora Core 6)

Changed in inkscape:
status: Incomplete → Confirmed

The attached patch makes use of UniConvertor (available on all supported platforms, contrary to wmf2svg), which fixes both rendering issue and the impossibiility to edit imported data.

Bryce Harrington (bryce) wrote :

Applied for 0.46 release.

Changed in inkscape:
status: Confirmed → Fix Released
Davespagnol (davespagnol) wrote :

Thanks! Texstart added the patch to the 0.45 testing version currently with PCLinuxOS and it works!

The wmf attached was created by another graphic software.
Usually I have to make some correction to the drawing.
Metafile Companion does the job nicely.
I'm trying to use Inkscape for his greater usability but this bug is blocking
the input and therefore the choice.
Any suggestions?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.