Bug 60638

Summary: EMF+ files rendered as empty boxes
Product: LibreOffice Reporter: kaare
Component: graphics stackAssignee: Muthu <muthu.subramanian.karunanidhi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: chris.sherlock79, fridrich.strba, frob, mst.fdo, muthusuba, qubit, rodo, serval2412
Version: 4.1.0.0.alpha0+ Master   
Hardware: Other   
OS: Linux (All)   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=59405
https://bugs.freedesktop.org/show_bug.cgi?id=60651
Whiteboard: BSA target:4.1.0
i915 platform: i915 features:
Attachments: Visio 2010 vdx file
Well-known Cisco's "router" icon in EMF format.

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 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 2013-02-25 13:09:44 UTC
ah nice my fix for bug 59405 lets the attached EMF show up...
Comment 8 Michael Stahl 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 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.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.