Inkscape destroys texts and small lines in emf images

Bug #1599763 reported by Steffen Guhlemann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Background:
For scientific work (like my phd) i use Lyx (on windows 7, 64 bit in case this matters). Most images i draw myself using powerpoint, exporting them as emf and including them in lyx. For those, who don't know, Lyx is kind of syntactic sugar on top of latex, easing a lot of stuff as for instance image format management. Under the hood for each latex run lyx uses image converters to convert arbitary formats to something latex can handle (e.g. pdf or eps).
Until may, lyx 2.1.4 used some set of command line tools (e.g. metafile2eps) to convert the images, from lyx 2.2. (may 2016) lyx switched to use inkscape for almost all image conversions.
=> By updating lyx from 2.1.4 to 2.2 i implicitely switched from metafile2eps to inkscape to convert emf images (without knowing about this).

This completely scrambled my emf images.
1) (maybe this is no bug, but a feature - only you can judge): The images now have a more reasonable size after conversion. If exporting something from a single powerpoint slide to emf using lyx2.1.4 and metafile2eps, i had to scale the image to something very tiny (5%) to cover the width of a A4-page. Now - using lyx2.2. and inkscape the scaling is way more reasonable for the intuitive user (but i am not sure, if there is something as "correct" here, and if so, what is correct.)

2.) Actual bug(s):
2.1.) If opening the emf using inkscape, i get the same picture i see in the lyx-document (kind of a preview). There most of the drawings are retained, only all textual labels used in the emf are moved to the topleft of the image all drawn on top of other.

2.2.) If generating a pdf out of lyx (using pdflatex) lyx seems to use inkscape to convert the emf to a pdf (which then is used by latex). I get the same picture if manually opening the emf in inkscape and then save as pdf. In this case not only bug 2.1. applies (all text is moved to the topleft). Further all text is moved further out, so that only parts of the scrambled text are visible any more AND certain lines (which were still present in 2.1. (opening emf in inkscape) just disappear.

I'll attach an example of a wrong handled emf file. (If necessary i can also supply a "ground-truth"-png-Version of the image in case there are doubts, how this is supposed to look like and the result of the inkscape pdf-export of this file. Currently the bugs launchpad seems not to allow me to attach more than 1 file.)
*In the correct image, in the left there are 3 arrows with 5 labels, in the right there is a table of numbers and one arrow and label pointing to one of the cells.
*After opening in inkscape i only see the arrows (3 in the left and one pointing to the table) and the empty table. To the topleft a lot of text is drawn on top of each other.)
* After saving as pdf, i see a lot of white space in the left, with just some serif edges of some letters on the very top left. all arrows are gone. The empty table is still there, but the right boundary line of the table is cut off.

Revision history for this message
Steffen Guhlemann (steffenguhlemann) wrote :
Revision history for this message
Alvin Penner (apenner) wrote :

- not reproduced on Windows 7, Inkscape 0.91 r13725 (Jan 30 2015)
- attached is a screenshot of what the file looks like in Inkscape
- could you indicate, which OS?, which version of Inkscape (see the menu item Help->About)

Revision history for this message
Steffen Guhlemann (steffenguhlemann) wrote : RE: [Bug 1599763] Re: Inkscape destroys texts and small lines in emf images
Download full text (4.9 KiB)

1. the png is the way it is supposed to look like2. it is strange, now i can't reproduce it either, also i just saw the error again when writing the bug report this morning. I can sent you the pdf i created this morning. (i.e. i did not make this up...)(I just did a fresh installation of my work laptop, so maybe i did something this morning that changed the interpretation of emf files, like opening (a new version of) power point for the first time...)=> i will investigate at unchanged laptops at home this evening (and try out what happens if using lyx 2.2. (to keep working i reinstalled the last version of the 2.1 branch instead).=> i'll tell you tomorrow my state...
=> in any case i am using windows 7 professional (64 bit, at home also one netbook with 32 bit) with recent updates. until last week i had office 2010 on my work laptop, now i have office 365.
      inkscape is 0.91 r13725. The exe is from Jan 30 2015.
sorry for the strange situation.
regards, Steffen
> Date: Thu, 7 Jul 2016 11:59:51 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 1599763] Re: Inkscape destroys texts and small lines in emf images
>
> - not reproduced on Windows 7, Inkscape 0.91 r13725 (Jan 30 2015)
> - attached is a screenshot of what the file looks like in Inkscape
> - could you indicate, which OS?, which version of Inkscape (see the menu item Help->About)
>
> ** Attachment added: "levenshtein.png"
> https://bugs.launchpad.net/inkscape/+bug/1599763/+attachment/4696818/+files/levenshtein.png
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1599763
>
> Title:
> Inkscape destroys texts and small lines in emf images
>
> Status in Inkscape:
> New
>
> Bug description:
> Background:
> For scientific work (like my phd) i use Lyx (on windows 7, 64 bit in case this matters). Most images i draw myself using powerpoint, exporting them as emf and including them in lyx. For those, who don't know, Lyx is kind of syntactic sugar on top of latex, easing a lot of stuff as for instance image format management. Under the hood for each latex run lyx uses image converters to convert arbitary formats to something latex can handle (e.g. pdf or eps).
> Until may, lyx 2.1.4 used some set of command line tools (e.g. metafile2eps) to convert the images, from lyx 2.2. (may 2016) lyx switched to use inkscape for almost all image conversions.
> => By updating lyx from 2.1.4 to 2.2 i implicitely switched from metafile2eps to inkscape to convert emf images (without knowing about this).
>
> This completely scrambled my emf images.
> 1) (maybe this is no bug, but a feature - only you can judge): The images now have a more reasonable size after conversion. If exporting something from a single powerpoint slide to emf using lyx2.1.4 and metafile2eps, i had to scale the image to something very tiny (5%) to cover the width of a A4-page. Now - using lyx2.2. and inkscape the scaling is way more reasonable for the intuitive user (but i am not sure, if there is something as "correct" here, and if so, what is correct.)
>
> 2.) Actual bug(s):
> 2.1.) If opening th...

Read more...

Revision history for this message
Steffen Guhlemann (steffenguhlemann) wrote :
Download full text (4.2 KiB)

Hi again,
after installing Lyx2.2 (which under the hood again installes inkscape) i get my error again. (First i tried using lyx, then i opened the emf using lyx.) As if inkscape just switched to a different state...

I'll attach some screen shots.... Can i somehow help to track down this?
regards, steffen

> Date: Thu, 7 Jul 2016 11:59:51 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 1599763] Re: Inkscape destroys texts and small lines in emf images
>
> - not reproduced on Windows 7, Inkscape 0.91 r13725 (Jan 30 2015)
> - attached is a screenshot of what the file looks like in Inkscape
> - could you indicate, which OS?, which version of Inkscape (see the menu item Help->About)
>
> ** Attachment added: "levenshtein.png"
> https://bugs.launchpad.net/inkscape/+bug/1599763/+attachment/4696818/+files/levenshtein.png
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1599763
>
> Title:
> Inkscape destroys texts and small lines in emf images
>
> Status in Inkscape:
> New
>
> Bug description:
> Background:
> For scientific work (like my phd) i use Lyx (on windows 7, 64 bit in case this matters). Most images i draw myself using powerpoint, exporting them as emf and including them in lyx. For those, who don't know, Lyx is kind of syntactic sugar on top of latex, easing a lot of stuff as for instance image format management. Under the hood for each latex run lyx uses image converters to convert arbitary formats to something latex can handle (e.g. pdf or eps).
> Until may, lyx 2.1.4 used some set of command line tools (e.g. metafile2eps) to convert the images, from lyx 2.2. (may 2016) lyx switched to use inkscape for almost all image conversions.
> => By updating lyx from 2.1.4 to 2.2 i implicitely switched from metafile2eps to inkscape to convert emf images (without knowing about this).
>
> This completely scrambled my emf images.
> 1) (maybe this is no bug, but a feature - only you can judge): The images now have a more reasonable size after conversion. If exporting something from a single powerpoint slide to emf using lyx2.1.4 and metafile2eps, i had to scale the image to something very tiny (5%) to cover the width of a A4-page. Now - using lyx2.2. and inkscape the scaling is way more reasonable for the intuitive user (but i am not sure, if there is something as "correct" here, and if so, what is correct.)
>
> 2.) Actual bug(s):
> 2.1.) If opening the emf using inkscape, i get the same picture i see in the lyx-document (kind of a preview). There most of the drawings are retained, only all textual labels used in the emf are moved to the topleft of the image all drawn on top of other.
>
> 2.2.) If generating a pdf out of lyx (using pdflatex) lyx seems to use inkscape to convert the emf to a pdf (which then is used by latex). I get the same picture if manually opening the emf in inkscape and then save as pdf. In this case not only bug 2.1. applies (all text is moved to the topleft). Further all text is moved further out, so that only parts of the scrambled text are visible any more AND certain lines (...

Read more...

Revision history for this message
Alvin Penner (apenner) wrote :

I would suggest you do a complete search of your hard disk looking for the file inkscape.exe to see if you have more than one version present, and to confirm the inkscape rev number for each version that you find.

Revision history for this message
Alvin Penner (apenner) wrote :

I am reading the post at:
http://www.lyx.org/trac/ticket/10197

I think it would be appropriate to repeat the advice given there:
•EMFs are now converted using another converter program (if available it is Inkscape). Therefore other results can be expected. Using EMFs in laTeX documents is not a good idea. EMF is Windows-only and cannot be embedded to any output format. Thus convert the EMFs to a PDF image and you won't have any problems with different converter results (or even no result on Mac and Linux).

I would recommend that you install a recent version of Inkscape, do your own, independent, conversion from emf to pdf using Inkscape, and then use that pdf output in Lyx. This will avoid confusion as to what the source of the problem is.

Changed in inkscape:
status: New → Incomplete
Revision history for this message
Steffen Guhlemann (steffenguhlemann) wrote :

Hi,
> I am reading the post at:> http://www.lyx.org/trac/ticket/10197
>
> I think it would be appropriate to repeat the advice given there:
> •EMFs are now converted using another converter program (if available it is Inkscape). Therefore other results can be expected. Using EMFs in laTeX documents is not a good idea. EMF is Windows-only and cannot be embedded to any output format. Thus convert the EMFs to a PDF image and you won't have any problems with different converter results (or even no result on Mac and Linux).
>
=> 2 thoughts about this. 1.First of all, this was the first reply out of 4, and all the others knew and recognized that lyx's ability to eat whatever image formats you'll feed it is a value in itself, as it automates tedious and error prone manual labor. If i'll change my drawings a tiny bit (which happens very often with over 100 drawings), i don't want to go through a long manual process there all the time. And for the choice of the format - it is the only reasonable vector graphics format power point can export. And emf is never used directly in latex, it is automatically converted by lyx (using helpers like now inkscape).
2. I just filed a bug on inkscape after we realized after long discussion that this is an inkscape and no lyx issue. Do you want to tell me, that the behaviour i observe using a fresh install of inkscape is correct (i.e. no bug)?
> I would recommend that you install a recent version of Inkscape, do your
> own, independent, conversion from emf to pdf using Inkscape, and then
> use that pdf output in Lyx. This will avoid confusion as to what the
> source of the problem is.
3. I just did this and see exactly the scrambling i observe when using lyx.
regards, Steffen

Revision history for this message
Alvin Penner (apenner) wrote :

- which version of Inkscape? You can find this out at the menu item Help->About.
- can you attach the svg file you obtain when you load your emf file into Inkscape?
- I am attaching the result I obtain in Inkscape 0.91 r13725 (Jan 30 2015)

Revision history for this message
Steffen Guhlemann (steffenguhlemann) wrote :
Download full text (3.4 KiB)

> - which version of Inkscape? You can find this out at the menu item Help->About.
as i already specified i use the most recent one i can download: 0.91, r13725, exe-Creation-Time 30th of Januar, 2015. (don't know, if a lyx2-2 installation overwrites some files there, but in the main inkscape installation directory i found this. And this was the exe i started, when i tried to reproduce the bug directly (i.e. not indired via lyx))Operating system(s)/Environments tested:* Windows 7 Ultimate 64 bit+Office 2010 Professional (in case office has an influence on the handling of emf)* Windows 7 Professional 64 bit + Office 365* Windows 10 Pro (x86 and 64 bit both), Office 2010 Professional
=> each time i got the same result (but although the laptops are different, i installed quite the same software on all of them)
The bug seems to depend on some state of inkscape. (Before i always saw the bug on all machines, yesterday i had 15 minutes, where inkscape did the right thing - then switching back to the bug without changes on my side) In case this helps, i'll specify my inkscape related handlings and observations.* On all(?) machines (except the fresh installation of the first one) i first installed Lyx2.1.4 (the version without inkscape), much later inkscape 0.91 to work with xps-files which i online converted to pdf and then edited in inkscape. This worked and still works. * At this point in time i did not test the handling of emf files. * Then I installed Lyx 2.2. (which uses and brings(?) inkscape for image conversion) Not sure, what exactly they do with inkscape. For the smaller converters of lyx 2.1.4, those were just put in a private subdirectory of the lyx-directory. I don't know if they recognize the inkscape installation and leave it like it is or do a private installation of inkscape.* Then i realized, that my generated pdf was scrambled, later i realized that this mostly because of scrambled (and shrunken - which probably is a feature and not a bug) emf images. * Then i investigated and found inkscape as the program in charge. I tried manually to open the emf's and saw the described error (scrambling of texts when opening, more scrambling and removal of lines when saving as pdf).* After my fresh install some days ago, i installed inkscape 0.91 and lyx 2.1.5. (don't know in which order). Had no time to play with inkscape. Yesterday - just before filing the bug - i tested again and saw the bug. After your first reply yesterday ("...not reproduced on 0.91...") i tried myself and for 15 minutes inkscape did the correct thing (i did not change my actions and luckily in the recycle bin i still found a garbled pdf from before filing the bug).* Then i thought about if this lucky state change might also have solved my problem with lyx (even if it did i would not know how to cure the rest of the laptops or later installs). So i installed Lyx2.2. => the images were still scrambled. I then tried again to open the emf in inkscape - and the bug was there again (doing exactly what i did 15 minutes before - open inkscape, file->open ... emf (and later save as pdf)* Now the bug is again present on all my machines.
> - can you attach the svg file you obtain w...

Read more...

Revision history for this message
Alvin Penner (apenner) wrote :

Well, I am at a loss, don't know what is going on. However, two things that should be tried.
- first do a global search of your entire hard disk to confirm that there is one and only one instance of the file inkscape.exe
- second, do an Inkscape re-install to make sure that Inkscape is the most recent installation, just in case lyx is accidentally overwriting some of the Inkscape libraries.

Revision history for this message
Steffen Guhlemann (steffenguhlemann) wrote :

I did not find any other inkscape instance, but i am not sure about this point. At least i did some experiments with reinstallation:

1. on a more or less fresh install of Windows 10 (64 bit) (some other programs, e.g. Visual studio, office were already installed) i installed inkscape 0.91 (64 bit)
2. I tested again using the levenshtein-emf example linked above
2.1. open inkscape and open the file
=> correct
2.2. save as pdf => partly incorrect - all 4 lines with arrows are gone

3. I then installed lyx 2.2.1
4. Without ever starting lyx i repeated my experiments of 2.
=> just after opening the texts are scrambled (stacked on top of each other in the top left)
=> saving as pdf additionally destroys all lines with arrows

5. i tried to reinstall inkscape
5.1. deinstall inkscape
5.2. run the installer again
5.3. repeat experiment 2.
=> again, directly after opening the emf the texts are broken (stacked in the top left)

su_v (suv-lp)
Changed in inkscape:
status: Incomplete → New
Revision history for this message
Patrick Storz (ede123) wrote :

This should be mostly fixed in
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15617

Texts should be shown in the correct positions now.

Please check if there are any regressions, otherwise I'll push to 0.92.x soon.

Revision history for this message
Patrick Storz (ede123) wrote :

The only issue remaining (as far as I can see) are the arrows that are still missing in the PDF output.

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

Other bug subscribers

Remote bug watches

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