Bug 73764 - Other: Wrongly rendered fill of EMF files
Summary: Other: Wrongly rendered fill of EMF files
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.1.4.2 release
Hardware: Other Linux (All)
: medium normal
Assignee: Andras Timar
URL:
Whiteboard: BSA target:4.3.0 target:4.2.0
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-01-18 14:07 UTC by Fridrich Strba
Modified: 2020-02-03 10:49 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Word Document with two EMF files (53.50 KB, application/msword)
2014-01-18 14:07 UTC, Fridrich Strba
Details
Screenshot of document rendered in Word (73.75 KB, image/png)
2014-01-18 14:09 UTC, Fridrich Strba
Details
patch (534 bytes, patch)
2014-01-19 16:45 UTC, Andras Timar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fridrich Strba 2014-01-18 14:07:43 UTC
Created attachment 92335 [details]
Word Document with two EMF files

Problem description: 

Steps to reproduce:
1. Open the attached document in LibreOffice

Current behavior: The two images are wrongly rendered

Expected behavior: The two images should be rendered as in the screenshot

              
Operating System: Linux (Other)
Version: 4.1.4.2 release
Comment 1 Fridrich Strba 2014-01-18 14:09:34 UTC
Created attachment 92336 [details]
Screenshot of document rendered in Word
Comment 2 Fridrich Strba 2014-01-18 14:11:24 UTC
Andras, I saw you doing some stuff with EMF files. This one could be interesting, I guess.
Comment 3 Fridrich Strba 2014-01-18 14:13:53 UTC
It seems that this file has no EMF+ content at all, it is a plain EMF. It is possible that we are not handling gradient fills right in that case?
Comment 4 Andras Timar 2014-01-18 14:39:18 UTC
LibreOffice 4.0.x renders it correctly.
Comment 5 Andras Timar 2014-01-18 21:33:01 UTC
 3998d1abb291309ddbbc2c9869736ebb1ea608f0 is the first bad commit
commit 3998d1abb291309ddbbc2c9869736ebb1ea608f0
Author: Lennard Wasserthal <Wasserthal@nefkom.net>
Date:   Sat Feb 9 13:47:38 2013 +0100

    fdo#56886 EMF: Fixes some scaling problems of clipped regions, Twips
    
    If a Metafile's scaling is incompletely defined, there are some arbitrary values used.
    This bug is just filed as regression because aoo 3.3 used the WMF part and Lo the EMF part!
    Please use environment variable EMF_PLUS_DISABLE if you have further problems with EMF files.
    This Patch also adds an (untested) TWIPS scaling, which was missing.
    known issue: vertical text ratio still scaled differently than lineart.
    
    Change-Id: I7c0139853961eb338476a9e3a5e08d3f87225f2e
    Signed-off-by: Lennard Wasserthal <Wasserthal@nefkom.net>
    Reviewed-on: https://gerrit.libreoffice.org/1886
    Reviewed-by: Tor Lillqvist <tml@iki.fi>
    Tested-by: Tor Lillqvist <tml@iki.fi>
Comment 6 Fridrich Strba 2014-01-19 11:39:21 UTC
(In reply to comment #5)
>     Please use environment variable EMF_PLUS_DISABLE if you have further
> problems with EMF files.

Just to note that on these specific EMF files the EMF_PLUS_DISABLE will not make any difference, since they don't have any EMF+ records and the same path of rendering is used whether the EMF_PLUS_DISABLE is set or not.
Comment 7 Andras Timar 2014-01-19 16:45:44 UTC
Created attachment 92405 [details]
patch

This patch fixes the issue, but I'm afraid, that it will cause regression elsewhere. Lennard, your feedback is welcome.
Comment 8 Lennard Wasserthal 2014-01-19 17:39:16 UTC
Well...
I think your patch just reverts a part of my patch. And as far as I remember, the case where it is executed is not encurred in my case. Just try it. Thanks for the work!!!

I made this part because I thought it would follow the specification better.

(EMF/WMF is a sick fileformat anyway, because it is grown.
In informatics, grown things are always defective.
If you want a algorithm, interface or datastructure to be usable, you must design it from start to end in one affusion.

Please submit it ... I am rather short on time and everything I am trying with the libreoffice code at the moment fails.
Comment 9 Andras Timar 2014-01-19 18:00:24 UTC
(In reply to comment #8)
> Well...
> I think your patch just reverts a part of my patch. And as far as I
> remember, the case where it is executed is not encurred in my case. 

Yes, your case on the else branch. Thanks for the quick reply.
Comment 10 Commit Notification 2014-01-19 18:03:38 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=70068f428d570a4ee00c682f1b8e12de395a8be4

fdo#73764 partially revert 3998d1abb291



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 11 Commit Notification 2014-01-21 15:27:44 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ade704ea4ac7317f2ad300c8321c64ba54d0e692&h=libreoffice-4-2

fdo#73764 partially revert 3998d1abb291


It will be available in LibreOffice 4.2.1.

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 Commit Notification 2014-01-21 17:22:44 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "libreoffice-4-2-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=22818d9fb7551d8f2a7d9389d28dd96b794a1e89&h=libreoffice-4-2-0

fdo#73764 partially revert 3998d1abb291


It will be available already in LibreOffice 4.2.0.

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.