Download it now!
Bug 47291 - FILEOPEN: scrambled Vector Graphic (EMF) with negative points
Summary: FILEOPEN: scrambled Vector Graphic (EMF) with negative points
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other Windows (All)
: medium major
Assignee: Caolán McNamara
URL:
Whiteboard: target:3.7.0 target:3.6.4 target:3.5.8
Keywords: regression
Depends on:
Blocks:
 
Reported: 2012-03-13 15:22 UTC by Jochen
Modified: 2013-11-29 20:34 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Logo in writer (40.04 KB, application/vnd.oasis.opendocument.text)
2012-03-13 15:22 UTC, Jochen
Details
Logo embedded (25.33 KB, application/vnd.oasis.opendocument.graphics)
2012-03-13 15:23 UTC, Jochen
Details
original MS Word Template (53.00 KB, application/msword)
2012-03-13 15:24 UTC, Jochen
Details
Extracted SVG (165.17 KB, image/svg+xml)
2012-03-14 00:27 UTC, Rainer Bielefeld Retired
Details
bfav_briefpapier_v5_1.wmf (45.92 KB, image/x-wmf)
2012-03-14 02:49 UTC, Jochen
Details
bfav_briefpapier_v5_3.emf (66.69 KB, image/x-emf)
2012-03-14 02:50 UTC, Jochen
Details
bfav_briefpapier_v5_3.eps (727.31 KB, application/postscript)
2012-03-14 02:50 UTC, Jochen
Details
Office 2010 SP 1 vs. LibO 3.5.1.2 (174.02 KB, image/jpeg)
2012-03-16 08:03 UTC, Florian Reisinger
Details
example 2 orignal doc (57.00 KB, application/msword)
2012-09-06 14:54 UTC, jkonecny
Details
example 2 screenshot LO (47.85 KB, image/png)
2012-09-06 14:54 UTC, jkonecny
Details
example 2 screenshot MS Viewer (30.54 KB, image/png)
2012-09-06 14:55 UTC, jkonecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jochen 2012-03-13 15:22:44 UTC
Created attachment 58397 [details]
Logo in writer

An external MS Word Template containing a Vector Graphic Header could be opened and modified by Writer and Draw later using LO 3.4.5.
Using LO 3.5.0 the same vector graphic shows up scrambled.
This won't change if loading the original word template with LO 3.4.5 (or earlier) and resaving it again in .doc or .odt format.
This scrambling graph persists, even if exported in a .pdf file.
Unfortunately the original SVG used in the word template isn't available.
See attachments "Logo in writer", "Logo embedded" and "original MS Word Template"
Comment 1 Jochen 2012-03-13 15:23:48 UTC
Created attachment 58398 [details]
Logo embedded
Comment 2 Jochen 2012-03-13 15:24:34 UTC
Created attachment 58399 [details]
original MS Word Template
Comment 3 Rainer Bielefeld Retired 2012-03-14 00:26:59 UTC
[Reproducible] with "LibreOffice 3.5.1.2 German UI/Locale [Build-ID: dc9775d-05ecbee-0851ad3-1586698-727bf66] on German WIN7 Home Premium (64bit): In "BFAV_Briefvorlage_2seitig.dot" and "Logo_Einbindung_in_Writer_fehlerhaft.odt" ths logo looks terribly damaged.

Looks fine with 3.4.5, so REGRESSION

for original view see attached "testlogo.svg"

I opened "BFAV_Briefvorlage_2seitig.dot" with various versions and found out:

Looks ok with Server installation of Master "LibO-dev 3.5.0 – WIN7 Home Premium (64bit) English UI [(Build ID: 81607ad-3dca5fd-da627d2)]" (2011-09-13) and older

[Reproducible] with parallel installation of MinGW Master "LibO-dev 3.5.0 – WIN7 Home Premium (64bit) English UI [(Build ID:  308b7a2-e916bf9-9c6ea62-e1a2fb3)] (daily/MinGW_cross-compilation 2011-10-18_22.56.49)" and later


@Jochen:
Is the original logo.svg available? Can you contribute some more explication how the documents have been created?
Comment 4 Rainer Bielefeld Retired 2012-03-14 00:27:44 UTC
Created attachment 58420 [details]
Extracted SVG

Shows normal view in Browser
Comment 5 Rainer Bielefeld Retired 2012-03-14 00:28:52 UTC
Deleted link to bug concerning different problem
Comment 6 Jochen 2012-03-14 01:39:27 UTC
@Rainer:
I made a request to the design studio. Maybe they send me the original document, the name of the DTP program and the system, with which the file has been created (Mac/Win).
Comment 7 Jochen 2012-03-14 01:45:57 UTC
Is this bug the same bug as 38848?
Comment 8 Jochen 2012-03-14 02:49:18 UTC
The vectorgraph has been generated by Adobe Illustrator on Win XP as an encapsulated post script file (.eps). The graphs were placed as windows meta files into the word doc.

All original files are attached (bfav_briefpapier_v5_1.wmf, bfav_briefpapier_v5_3.eps and bfav_briefpapier_v5_3.emf)
Comment 9 Jochen 2012-03-14 02:49:54 UTC
Created attachment 58425 [details]
bfav_briefpapier_v5_1.wmf
Comment 10 Jochen 2012-03-14 02:50:22 UTC
Created attachment 58426 [details]
bfav_briefpapier_v5_3.emf
Comment 11 Jochen 2012-03-14 02:50:58 UTC
Created attachment 58427 [details]
bfav_briefpapier_v5_3.eps
Comment 12 sasha.libreoffice 2012-03-14 06:01:08 UTC
I see no problem with attached svg file.
odt file may be corrupted, Word 2007 opens it wrong, site 
http://odf-validator.rhcloud.com/ tells that it contains errors
dot file from attachment contains emf picture, not svg

May be needed enumerated steps how to reproduce bug from svg?

Or remove word svg from title.
in 3.3.4 on Fedora 64 bit attached dot file opens correctly, but in 3.5.1 opens wrong
On Windows XP 32 bit in 3.4.3 opens correctly, in 3.5.0 beta 3 opens wrong

So I see only regression with dot file and no problem with svg
Comment 13 Rainer Bielefeld Retired 2012-03-14 07:15:45 UTC
This has nothing to do with SVG

The clear and simple problem is some kind of embedded Vector Graphics rendering issue. I extracted the logo by saving "BFAV_Briefvorlage_2seitig.dot" from LibO 3.4.5 as BFAV_Briefvorlage_2seitig.odt, renaming it to "BFAV_Briefvorlage_2seitig.zip" and comparing found "200003D000004C8B00002637A32CB0F8.wmf" with "bfav_briefpapier_v5_1.wmf"

"bfav_briefpapier_v5_1.wmf":
Looks fine for FILEOPEN DRAW and Insert Picture from file with DRAW and WRITER with LibO 3.4.5 and LibO 3.5.1 RC

"200003D000004C8B00002637A32CB0F8.wmf":
Looks fine for FILEOPEN DRAW and Insert Picture from file with DRAW and WRITER with LibO 3.4.5, but always scrambled with 3.2.1RC

I am pretty sure that all other observed issues are related to this one. I do not belive that further investigation will be required. 


@Jochen:
"Bug 38848 - FILEOPEN: VIEWING LibreOffice_external_logo.SVG view cruelly damaged" indeed has some similar effects (misplaced elements), but I doubt that thes2 2 bugs are DUPlicates

@all: 
It would be interesting ot know whether that problem is limited to that one and only logo.wmf or whether more or less all wmf in MS WORD documents are affected.
Comment 14 Florian Reisinger 2012-03-16 08:03:37 UTC
Created attachment 58564 [details]
Office 2010 SP 1 vs. LibO 3.5.1.2

Uploaded a side by side, some characters are damaged too...
Why not mark it as critical???

Win7 x64
Comment 15 Valek Filippov 2012-04-08 07:20:16 UTC
All letters and blue square in the NW corner are made with PolyPolygon WMF records.

Missed letters and square (I only looked for "BFAV" and "Bayerischer Facharztv") seem to have one common difference from displayed letters: PolyPolygon has no more than 11 points per polygon.
All those polygons seem to be closed paths (last point is the same as the first one). Letter "B" in "BFAV" is not visible because it's white on white. You can change BG colour under picture to verify it.

First "missed" records are 21,27,39,51,55,69,76,78 and 80.
Comment 16 jkonecny 2012-09-06 14:52:46 UTC
I'm seeing what I believe is the same problem with 3.6.1.2.  I'm going to add attachments of screenshots and the original doc.  I will start the file names with my test case "example-2-".
Comment 17 jkonecny 2012-09-06 14:54:27 UTC
Created attachment 66733 [details]
example 2 orignal doc
Comment 18 jkonecny 2012-09-06 14:54:54 UTC
Created attachment 66734 [details]
example 2 screenshot LO
Comment 19 jkonecny 2012-09-06 14:55:18 UTC
Created attachment 66735 [details]
example 2 screenshot MS Viewer
Comment 20 Rainer Bielefeld Retired 2012-10-16 06:58:01 UTC
Added bibisectrequest, not sure whether that really will help, more for training of bibisecting staff ;-)
Comment 21 Alex Thurgood 2012-10-16 09:33:22 UTC
(In reply to comment #15)
> All letters and blue square in the NW corner are made with PolyPolygon WMF
> records.
> 
> Missed letters and square (I only looked for "BFAV" and "Bayerischer
> Facharztv") seem to have one common difference from displayed letters:
> PolyPolygon has no more than 11 points per polygon.
> All those polygons seem to be closed paths (last point is the same as the
> first one). Letter "B" in "BFAV" is not visible because it's white on white.
> You can change BG colour under picture to verify it.
> 
> First "missed" records are 21,27,39,51,55,69,76,78 and 80.


Not linked to this refactoring by any chance ?
commit bcb1c850339c70a841e9a3a9b6eb68d1e031adb1
Author: Marc-Andre Laverdiere <marc-andre@atc.tcs.com>
Date:   Tue Sep 20 12:25:01 2011 +0530

    Refactoring drawing of polygons and polypolygons in enhwmf.cxx



Alex
Comment 22 Caolán McNamara 2012-10-26 13:52:52 UTC
yeah, there or thereabouts alright
Comment 23 Not Assigned 2012-10-26 13:57:38 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2536fae7b8565b5dd9f09bb3dc015576fafe4031

Resolves: fdo#47291 polypoly[line|gon] points are signed



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 24 Not Assigned 2012-10-26 16:22:43 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2f6d66b51364f1c34ea3be52187f98f175c3659b&g=libreoffice-3-6

Resolves: fdo#47291 polypoly[line|gon] points are signed


It will be available in LibreOffice 3.6.4.

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 25 Not Assigned 2012-10-26 17:48:04 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ef7f951cc3326f64a9e3e856bd90824c96496ff6&g=libreoffice-3-5

Resolves: fdo#47291 polypoly[line|gon] points are signed


It will be available in LibreOffice 3.5.8.

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 26 sasha.libreoffice 2012-10-27 09:52:05 UTC
Thanks for fixing this bug