Bug 116335 - EMF is opened with large empty space around it
Summary: EMF is opened with large empty space around it
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
3.4.0 release
Hardware: All All
: medium normal
Assignee: Bartosz
URL:
Whiteboard: target:7.1.0 target:7.0.4
Keywords: filter:emf, preBibisect, regression
: 116622 (view as bug list)
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
 
Reported: 2018-03-10 13:45 UTC by johan
Modified: 2020-11-16 14:32 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
example files (33.11 KB, application/octet-stream)
2018-03-10 13:46 UTC, johan
Details
Comparison (116.76 KB, image/png)
2018-03-18 17:21 UTC, Telesto
Details
Screenshot of nr. 2 (69.56 KB, image/png)
2018-03-24 15:57 UTC, johan
Details
Example .docx file with improper zoom level (7.77 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-03-27 21:09 UTC, Bartosz
Details
Comparison the same docx document, on Office 16 and LO 6.1 dev (496.68 KB, image/png)
2018-03-28 08:43 UTC, Bartosz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description johan 2018-03-10 13:45:17 UTC
Description:
Some EMF (Windows Enhanced Metafile) files are not displayed correctly when inserted into Writer or opened in Draw. Examples and a screenshot of Microsoft Word for comparison are attached below.

The following problems occur:

1) Lots of empty extra space is included on the right and bottom sides. 

2) The top part of the image is hidden when inserted into Writer. It will become visible if you use the crop tool and pull the top left crop handle outwards.

3) The curves extend outside the plot area even though they should not.

4) Additionally, the aspect ratio of the portrait example is wrong and the text elements are completely messed up.

Please note that Inkscape does not show the examples 100% correctly. You may need Windows software to view them correctly.

Steps to Reproduce:
1. Download and unpack the example files below
2. Insert the example EMF files into Writer or open them in Draw
3. Compare with the screenshot which shows a reference rendering in MS Word

Actual Results:  
The problems explained above occur.

Expected Results:
The images should look approximately the same as shown in the screenshot.


Reproducible: Always


User Profile Reset: No



Additional Info:
Tested with two Libreoffice versions on Windows and Linux.

Debian 9 "Stretch" x86-64:
Version: 5.2.7.2
Build ID: 1:5.2.7-1+deb9u2
CPU Threads: 4; OS Version: Linux 4.9; UI Render: default; VCL: gtk2; 
Locale: fi-FI (fi_FI.utf8); Calc: group

Windows 7 32-bit:
Version: 5.4.5.1
Build ID: 79c9829dd5d8054ec39a82dc51cd9eff340dbee8
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
Locale: fi-FI (fi_FI); Calc: group


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Comment 1 johan 2018-03-10 13:46:16 UTC
Created attachment 140544 [details]
example files

Example files - two EMF files and a reference screenshot in a Zip package.
Comment 2 Buovjaga 2018-03-11 16:08:48 UTC
There can be only one issue per report.

Please test with 6.0.x to be sure the problems are still current.

Then go through these to find existing reports: https://bugs.documentfoundation.org/showdependencytree.cgi?id=103859&hide_resolved=1

Finally, open a separate report for each remaining issue.
Comment 3 johan 2018-03-17 20:35:43 UTC
Tested with:

Version: 6.0.2.1
Build ID: f7f06a8f319e4b62f9bc5095aa112a65d2f3ac89
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
Locale: fi-FI (fi_FI); Calc: group

All problems still occur. I'll create separate reports soon unless someone wants to comment here.
Comment 4 Telesto 2018-03-17 20:56:54 UTC
Repro with
Version: 6.1.0.0.alpha0+
Build ID: e5bc7fa4e83b33fc3eee343e560a4f8cb91eacd6
CPU threads: 4; OS: Windows 6.3; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-03-14_23:37:38
Locale: nl-NL (nl_NL); Calc: CL

empty image with
LibreOffice 3.5.7.2 
Build ID: 3215f89-f603614-ab984f2-7348103-1225a5b

looks fine with:
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

List of know EMF/WMF issues: bug 103859

@Buovjaga
The description is pretty detailed. However, the (main) problem is pretty obvious.. this report will do.. Didn't check for similar reports
Comment 5 Buovjaga 2018-03-18 11:15:47 UTC
1) is seen when you select the object and notice the object borders. I wonder, if the file has clipping info and it would be the same root cause as bug 48916?

I cannot see the problem 2).

4) looks like bug 103903

So in my view there is no single "main problem".

Arch Linux 64-bit
Version: 6.1.0.0.alpha0+
Build ID: 070dbae6b4dc497d6ae898e60203d25b0e608d73
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on March 17th 2018
Comment 6 Telesto 2018-03-18 17:21:40 UTC
Created attachment 140687 [details]
Comparison
Comment 7 Buovjaga 2018-03-18 18:09:52 UTC
(In reply to Telesto from comment #6)
> Created attachment 140687 [details]
> Comparison

Problems 1) and 3) are visible in this.

Still curious about 2). Could johan produce a screenshot of it?
Comment 8 johan 2018-03-24 15:57:06 UTC
Created attachment 140861 [details]
Screenshot of nr. 2

Screenshot showing 2) attached. It occurs when the image is inserted into Writer.
Comment 9 Buovjaga 2018-03-24 16:27:59 UTC
Ok, let's make this report be about problem 1).

As problem 4) is likely bug 103903, please create new reports for problems 2) and 3).

Mention the new reports here, when you have created them and we will confirm them.
Comment 10 johan 2018-03-25 15:22:55 UTC
2) reported as bug 116622

3) reported as bug 116623


Additional notes that may be useful:

3) occurs in Inkscape as well (already reported)

4) occurs in Inkscape as well (already reported)

2) occurs in Inkscape - the image is placed partially outside the page/canvas area (not yet reported)

1) may occur in Inkscape, a matter of definition. The canvas/page area is much larger than the image itself when the image is opened. (not yet reported)
Comment 11 Bartosz 2018-03-27 21:09:20 UTC
Created attachment 140927 [details]
Example .docx file with improper zoom level
Comment 12 Xisco Faulí 2018-03-28 07:57:12 UTC
In case it helps, the chart started to get displayed after https://cgit.freedesktop.org/libreoffice/core/commit/?id=e6c5c854d6304d6a4e1ab0021a403ba95d16c785
Comment 13 Bartosz 2018-03-28 08:43:04 UTC
Created attachment 140931 [details]
Comparison the same docx document, on Office 16 and LO 6.1 dev
Comment 14 Xisco Faulí 2018-12-10 16:04:54 UTC
Dear Bartosz,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.
Comment 15 johan 2019-07-06 13:18:21 UTC
Tested on Windows 7, 32-bit, with a clean installation of:

Version: 6.2.5.2 (x86)
Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
CPU threads 4; OS: Windows 6.1; Rendering component: default; VCL: win; 
Locale: fi-FI (fi_FI); UI Language: fi-FI
Calc: threaded


This problem (nr. 1) still occurs.


Additional note which may be useful: This problem may occur in Inkscape (a matter of definition) - the canvas area is much larger than the actual image. Version 0.92.4 tested. This problems has already been reported to Inkscape developers.


Nr. 2) tested and commented at #116622

Nr. 3) tested and commented at #116623

Nr. 4) tested and commented at #103903
Comment 16 Timur 2020-11-10 09:41:32 UTC
In Bugzilla we pursue the issue, so classic advice is to split document issue to multiple different bugs. But here, with the same image being wrong, that shouldn't have been done, we just have 5 bugs and nobody to look at them. In similar cases, my opinion is: describe all issues and wait what's gonna happen in this bug. And raise importance because it's regression.
Comment 17 Commit Notification 2020-11-14 17:11:37 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b0b78838e795fcd7f3c53e7f74fb32b2921a5ccb

tdf#35986 tdf#92315 tdf#116335 tdf#116622 Add support for MapMode TEXT

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Buovjaga 2020-11-15 15:20:08 UTC
I verify that there is no longer the large empty space around the images!

Arch Linux 64-bit
Version: 7.1.0.0.alpha1+
Build ID: bd3aeaefff5e7bdef10c4702d1f388083557614e
CPU threads: 8; OS: Linux 5.9; UI render: default; VCL: kf5
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 15 November 2020
Comment 19 Bartosz 2020-11-15 20:36:58 UTC
*** Bug 116622 has been marked as a duplicate of this bug. ***
Comment 20 Commit Notification 2020-11-16 14:32:33 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/1c399bb1dc9af8d591258e936508200d38d3bb5a

tdf#35986 tdf#92315 tdf#116335 tdf#116622 Add support for MapMode TEXT

It will be available in 7.0.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.