Bug 39053 - EMF are not drawn correctly (gradient and text drawn correctly now, but the borders aren't)
Summary: EMF are not drawn correctly (gradient and text drawn correctly now, but the b...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected)
3.4.1 release
Hardware: All All
: medium normal
Assignee: Bartosz
Whiteboard: target:5.4.0
: 91636 (view as bug list)
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
Reported: 2011-07-07 17:35 UTC by Alistair Leslie-Hughes
Modified: 2017-08-30 16:52 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:

Sample Document. (38.98 KB, text/rtf)
2011-07-07 17:35 UTC, Alistair Leslie-Hughes
What I see on my screen when opening first attachment. (163.77 KB, image/png)
2011-07-07 18:12 UTC, Jeffrey
What image should look like (7.17 KB, image/png)
2011-07-08 02:18 UTC, Alistair Leslie-Hughes
Rendering with 3.4 (9.91 KB, image/png)
2011-07-08 04:42 UTC, tester8
Super/sub script example (15.97 KB, image/x-emf)
2012-02-03 08:33 UTC, mathog
Wide lines drawn as narrow, rotated text misplaced (13.12 KB, image/x-emf)
2012-02-03 08:44 UTC, mathog
EMF extracted from RTF. (21.48 KB, image/x-emf)
2012-04-20 17:31 UTC, Valek Filippov
Comprehensive EMF test case, most recent version (162.20 KB, video/unknown)
2015-07-09 17:40 UTC, mathog

Note You need to log in before you can comment on or make changes to this bug.
Description Alistair Leslie-Hughes 2011-07-07 17:35:35 UTC
Created attachment 48870 [details]
Sample Document.

Open the Attached Document.

Only one Rectangle is drawn which is at the bottom of the screen(class1)

Class2 and Class3 should also have a rectangle drawn around them.
Comment 1 Jeffrey 2011-07-07 18:12:57 UTC
Created attachment 48871 [details]
What I see on my screen when opening first attachment.

I'm sorry, but even though there is likely a problem, I do not think you have provided enough info. Seeing as there is a display problem with LibreOffice, it would have been better if you could have mentioned on which Office Suite for which OS did the rectangles appear properly, and provided an attachment image of the proper appearance so we can have a better idea of what the problem really is. Because it is very hard to verify something that you cannot see. Mentioning that rectangles do not display properly is not good enough to diagnose the situation.

Here is what I see: One rectangle is drawn across Class1, 2 and 3. I do not think this is what you meant, because there is no rectangle near the bottom. Can you confirm?
Comment 2 Alistair Leslie-Hughes 2011-07-08 02:18:45 UTC
Created attachment 48882 [details]
What image should look like

Please find attached an Image of what it should like like.
Comment 3 tester8 2011-07-08 04:41:00 UTC
LO 3.4.1 (OOO340m1 (Build:101))
Ubuntu 10.04.2 x86
Linux 2.6.32-32-generic Russian UI

Result is different from both images.
Comment 4 tester8 2011-07-08 04:42:41 UTC
Created attachment 48889 [details]
Rendering with 3.4

Rendering with LO 3.4
Comment 5 Jeffrey 2011-07-09 02:30:09 UTC
Sorry I forgot to mention my verison: LibreOffice 3.4  340m1(Build:12) for OpenSuse Linux. Still see the same thing that I did in the beginning. I wonder why I do not see the boxes at all...
Comment 6 Michael Cook 2011-12-07 05:54:36 UTC
Not sure if this is related but I've noticed if I create an EMF file with a
graphics program I can successfully add it to a .odt document under LibreOffice
for Windows.  If I then open the same document with LibreOffice Linux/Ubuntu I
see a completely garbled odd looking picture where the original image was

On saving the document under LibreOffice Ubuntu the image is simply removed
from the document. The image is not linked, but inserted.  I can reproduce this
on demand.

Originally found in: 

Ubuntu: LibreOffice 3.3.2 
OOO330m19 (Build:202)
tag libreoffice-, Ubuntu package 1:3.3.2-1ubuntu2~lucid1


Windows: 3.3.4

The EMF graphic was created by SmartDraw VP in Windows and is a network toplogy
diagram, not a chart.

I use Linux or Windows interchangably and OpenOffice didn't seem to suffer from
this difference in EMF file handling. I've tried Ubuntu 3.4.4 and still see a
garbled EMF diagram.  If I edit the document only on a Windows LibreOffice the
EMF diagram is not mangled.  If I import the same EMF diagram into Linux LibreOffice I see the same mangling.
Comment 7 Björn Michaelsen 2011-12-23 12:27:46 UTC Comment hidden (obsolete)
Comment 8 Alistair Leslie-Hughes 2011-12-23 23:22:53 UTC
3.5 beta 1 completely fails to parse the emf image and displays it as text within the document.

This is a serious regression since version 3.5 would display an image, even though not correctly.
Comment 9 mathog 2012-02-03 08:33:49 UTC
Created attachment 56579 [details]
Super/sub script example

Other EMF import bugs (3.5.0 rc1, Windows XP):

super/subscript is mangled when the EMF is reduced to objects with modify->break.  On initial import of EMF it looks OK, things only go wrong when the EMF is converted to LO objects.
Comment 10 mathog 2012-02-03 08:44:28 UTC
Created attachment 56580 [details]
Wide lines drawn as narrow, rotated text misplaced

Other EMF import bugs (3.5.0rc1 Windows XP)

1.  On EMF input of this example several of the wide lines are drawn very narrow, probably one pixel wide.  Internally they show a width of zero.  This happens, for instance, with the 72pt and 36pt lines, but not the 144pt (180px) line.

2.  On modify->break rotated text is offset from the correct position.

Note, this example was designed for testomg EMF insertion into PPT2003.  To get the right text sizes first set the LODraw page size to 10.84" x 7.5", margins all zero.  Import the EMF, then stretch to fit the page.  Modify->break.  Font sizes will then be as marked in the example. 

On Windows use "preview" to see what this EMF should look like.
Comment 11 Michael Meeks 2012-02-22 03:42:39 UTC
Radek - a set of EMF rendering issues, any ideas ? :-)
Comment 12 Björn Michaelsen 2012-03-01 09:03:30 UTC
Regression does appear in oldest version of bibisect-3.5.tar.lzma and must be older.
Comment 13 Michael Stahl (allotropia) 2012-03-08 11:26:17 UTC
not a Writer bug, we don't seem to have a GSL or VCL or even framework component (but a PDF export ?), so Libreoffice it is...
Comment 14 Miklos Vajna 2012-04-14 15:14:49 UTC
Additionally this seems to be an RTF regression as well, lacking the support for the \bin keyword.
Comment 15 Not Assigned 2012-04-15 05:43:45 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":


fdo#39053 writerfilter: implement RTF_BIN
Comment 16 Not Assigned 2012-04-15 05:44:11 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":


testcase for fdo#39053
Comment 17 Miklos Vajna 2012-04-15 05:45:21 UTC
Removing rtf_filter from whiteboard, the RTF filter now reads the EMF data correctly, the rest is independent from RTF. :-)
Comment 18 Valek Filippov 2012-04-20 17:31:23 UTC
Created attachment 60409 [details]
EMF extracted from RTF.
Comment 19 Not Assigned 2012-04-23 03:31:58 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":


fdo#39053 writerfilter: implement RTF_BIN

It will be available in LibreOffice 3.5.4.
Comment 20 Michael Stahl (allotropia) 2012-04-23 04:05:29 UTC
clearing target flags as that is only for the 3.5 RTF \bin import,
while the original problem remains;
Miklos should have filed a separate bug for that really...
Comment 21 Alistair Leslie-Hughes 2012-08-12 23:52:37 UTC
This issue still exists in 3.6.

The gradient and text are drawn correctly now, but the borders aren't drawn at all.
Comment 22 Timur 2014-10-20 15:52:37 UTC
*** Bug 35986 has been marked as a duplicate of this bug. ***
Comment 23 seven 2015-02-08 10:09:35 UTC
EN: In LibreOffice it is fixed. Please ckeck and close bug
RU: В LibreOffice это исправлено. Пожалуйста проверьте и закройте заявку
Comment 24 Timur 2015-05-11 14:26:22 UTC
(In reply to seven from comment #23)
> EN: In LibreOffice it is fixed. Please check and close bug
Not fixed. LO 5.0 opens the original attachment 48870 [details] the same as in the comment.
(In reply to Alistair Leslie-Hughes from comment #21)
> The borders aren't drawn at all.
Comment 25 Timur 2015-07-09 16:50:38 UTC
*** Bug 91636 has been marked as a duplicate of this bug. ***
Comment 26 mathog 2015-07-09 17:40:45 UTC
Created attachment 117162 [details]
Comprehensive EMF test case, most recent version

For those of you working on EMF support, here is my most recent test file, which exercises most of the features of that file type.
Comment 27 Timur 2015-08-17 15:53:42 UTC
*** Bug 35986 has been marked as a duplicate of this bug. ***
Comment 28 Robinson Tryon (qubit) 2015-12-14 05:40:03 UTC Comment hidden (obsolete)
Comment 29 Jean-Baptiste Faure 2016-04-13 05:03:17 UTC
In current master, the graphic is visible but shadows and some borders are missing.

Best regards. JBF
Comment 30 Jean-Baptiste Faure 2016-04-13 05:13:57 UTC
Not sure if this bug report still must be seen as a regression. Indeed regression keyword has been added for version 3.5 beta 1 that did not display the image at all. This problem has been fixed and we are back to the original bug description.

--> removing regression keyword.

Best regards. JBF
Comment 31 Xisco Faulí 2016-09-14 14:48:55 UTC
Only regressions should use the keyword 'preBibisect'. Removing it...
Comment 32 Bartosz 2017-03-30 21:11:58 UTC
What kind of EMF editor are you using?
Comment 33 mathog 2017-03-31 16:19:37 UTC
(In reply to Bartosz from comment #32)
> What kind of EMF editor are you using?

Was that directed at me?  The test files I post are from libUEMF


That library is used by inkscape for importing/exporting EMF/WMF on all platforms.  So to the extent I use an "EMF editor" it is Inkscape. For debugging EMF files there is a text dump program in libUEMF which works everywhere.  For Windows platforms one can also use Joseph Newcomer's excellent "MetafileExplorer" program.
Comment 34 Bartosz 2017-04-09 01:24:18 UTC
Review is available at:
Comment 35 Bartosz 2017-04-09 17:14:55 UTC
Review which fix this issue is available at:
Comment 36 Timur 2017-08-30 16:52:11 UTC
*** Bug 91636 has been marked as a duplicate of this bug. ***