Bug 60638 - EMF+ files rendered as empty boxes
Summary: EMF+ files rendered as empty boxes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
4.1.0.0.alpha0+ Master
Hardware: Other Linux (All)
: medium normal
Assignee: Muthu
URL:
Whiteboard: BSA target:4.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-11 09:14 UTC by kaare
Modified: 2013-05-06 06:09 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Visio 2010 vdx file (472.65 KB, application/vnd.visio.xml)
2013-02-11 09:14 UTC, kaare
Details
Well-known Cisco's "router" icon in EMF format. (11.25 KB, image/x-emf)
2013-02-18 16:34 UTC, Valek Filippov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kaare 2013-02-11 09:14:41 UTC
Created attachment 74589 [details]
Visio 2010 vdx file

Problem description: 
When loading a Visio (2010) drawing the Cisco stencils does not get shown correctly 

Current behavior:
When opening the drawing some stencils are missing

Expected behavior:
All Stenciels should show up.
              
Operating System: Ubuntu
Version: 4.1.0.0.alpha0+ Master
Comment 1 Robinson Tryon (qubit) 2013-02-12 11:06:01 UTC
Clarify language of title:

"Libvisio: Cisco stenciels donest get shown correctly" -> "Libvisio: Cisco stencils are not displayed properly"
Comment 2 Julien Nabet 2013-02-16 23:58:41 UTC
On pc Debian x86-64 with master sources updated today, on the 5 stencils, only 2 display.

Fridrich: one for you?
Comment 3 Valek Filippov 2013-02-18 16:34:06 UTC
Created attachment 75057 [details]
Well-known Cisco's "router" icon in EMF format.
Comment 4 Valek Filippov 2013-02-18 16:35:12 UTC
Fridrich, 3 of 5 shapes are using stencils. All stencils are 'ForeignShape' with wrapped EMF. 2 other shapes are unreferenced EMF files.

Half filled shape (2nd from the left) is EMF incorrectly handled by LO.
I extracted it, see attached file.
Comment 5 Fridrich Strba 2013-02-25 10:14:57 UTC
The emf files are extracted by libvisio just fine, only that LO emf+ renderer does not render them right :(
Comment 6 Michael Stahl (allotropia) 2013-02-25 13:02:20 UTC
Comment on attachment 74589 [details]
Visio 2010 vdx file

this appears to be a better mime-type... at least according to http://support.microsoft.com/kb/310331/de
Comment 7 Michael Stahl (allotropia) 2013-02-25 13:09:44 UTC
ah nice my fix for bug 59405 lets the attached EMF show up...
Comment 8 Michael Stahl (allotropia) 2013-02-25 14:02:14 UTC
the EMF attachment is fixed by bf8450cfa2e9e899c716fbddadd7d5485aefe520,
which simply writes the comments into the file; no idea if that
is a good idea in general though.

there are still 2 emtpy boxes in the Visio file.
Comment 9 Michael Stahl (allotropia) 2013-04-25 20:22:15 UTC
looks good in current 4.0 branch and master 80885bf2 but again
broken in current master: the second and third images now
don't have a white background (as in Visio2010) but a black one.

... aha ... git bisect says:

commit 4bc3ead0649bf2885050ec4cfb47a5ed13bfa41e
Author: Muthu Subramanian <sumuthu@suse.com>
Date:   Thu Apr 25 11:57:59 2013 +0530

    n#812793: (Workaround) Transparent background import in EMF+.
    
    EMF+ seems to have alpha of 0xff for transparent background!
Comment 10 Muthu 2013-04-26 08:35:16 UTC
Looks like I put the workaround in FillPolygons rather than FillRects.

Nevertheless, it is still a workaround, please do let me know if it breaks any other document as well.

[PS: I still haven't been able to figure out what makes MS consider as transparent during the background fill - while what is stored in the image is actually white :( ]
Comment 11 Commit Notification 2013-04-26 08:36:47 UTC
Muthu Subramanian committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5a1d77327867ae9b80bc676d67f1f70a5d8a2fd4

fdo#60638: Workaround should be in FillRects rather than FillPolygon.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Muthu 2013-05-06 06:09:59 UTC
marking this as fixed, so that somebody can verify.