Bug 127145 - [WMF] FILEOPEN File is rendered with thin stroke on rounded rectangles, but should be thick.
Summary: [WMF] FILEOPEN File is rendered with thin stroke on rounded rectangles, but s...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.6.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Bartosz
URL:
Whiteboard: target:7.2.0 target:7.1.5
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-25 07:28 UTC by JSR_LibreOffice
Modified: 2021-08-19 10:55 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
the DOC file - a figure is copied to a Word file (.doc) (23.00 KB, application/msword)
2019-08-25 07:28 UTC, JSR_LibreOffice
Details
Here is a PNG figure from Word file (.doc) (64.39 KB, image/png)
2019-08-25 07:35 UTC, JSR_LibreOffice
Details
Here is the ODT file - the figure is copied from the Word (.doc) this this ODT file (39.49 KB, application/vnd.oasis.opendocument.text)
2019-08-25 07:39 UTC, JSR_LibreOffice
Details
The borders of the boxes are rather thing - the ODT file (99.85 KB, image/png)
2019-08-25 07:42 UTC, JSR_LibreOffice
Details
The included image (6.16 KB, image/x-wmf)
2019-08-25 12:32 UTC, Regina Henschel
Details
the view from Calligra Words 2.9.6. (104.42 KB, image/png)
2019-08-25 17:11 UTC, JSR_LibreOffice
Details
the exported PDF file by Calligra Words 2.9.6. (192.28 KB, application/pdf)
2019-08-25 17:12 UTC, JSR_LibreOffice
Details
The view on WPS Writer displays the figure correctly. (142.58 KB, image/png)
2019-08-26 09:16 UTC, JSR_LibreOffice
Details
Word (.doc) document created with WPS Writer (12.00 KB, application/msword)
2019-08-26 09:17 UTC, JSR_LibreOffice
Details
Exported PDF from WPS Writer file displays the figure correctly. (185.70 KB, application/pdf)
2019-08-26 09:18 UTC, JSR_LibreOffice
Details
Here is more information about this bug. (200.62 KB, application/x-zip-compressed)
2019-08-28 08:30 UTC, JSR_LibreOffice
Details
DOC file - only one figure (68.47 KB, application/x-zip-compressed)
2021-03-24 11:46 UTC, JSR_LibreOffice
Details
Minimal WMF file, on which the issue is reproducible (534 bytes, image/wmf)
2021-03-24 14:59 UTC, Bartosz
Details
Comparison LibreOffice 7.2 master and MSO 2010 (12.24 KB, image/png)
2021-05-21 17:07 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JSR_LibreOffice 2019-08-25 07:28:29 UTC
Created attachment 153626 [details]
the DOC file - a figure is copied to a Word file (.doc)

1.
The figure is created in one program.

2.
The figure is copied to a Word file (.doc).

3.
Comment 1 JSR_LibreOffice 2019-08-25 07:35:58 UTC
Created attachment 153627 [details]
Here is a PNG figure from Word file (.doc)


Here is a PNG figure from the Word file.

Borders of boxes are rather wide in the Word file.
Comment 2 JSR_LibreOffice 2019-08-25 07:39:49 UTC
Created attachment 153628 [details]
Here is the ODT file - the figure is copied from the Word (.doc) this this ODT file


Next phase.

Here is the ODT file - the figure is copied from the Word (.doc) this this ODT file.
Comment 3 JSR_LibreOffice 2019-08-25 07:42:36 UTC
Created attachment 153629 [details]
The borders of the boxes are rather thing - the ODT file


Next phase.

The borders of the boxes are rather thin in this ODT file.

The figure is not the same compared to the Word (.doc) file.
Comment 4 Regina Henschel 2019-08-25 12:32:22 UTC
Created attachment 153636 [details]
The included image

I have saved the doc file to docx using Word 365 and then extracted the image and attached.

The problem is not in doc or docx import, but in the image itself. If you open the image in IrfanView or Paint or PaintShopPro (those I have tested), then the stroke for the rounded rectangles is thick. If you insert the image into Draw, the stroke is thin.
Comment 5 Regina Henschel 2019-08-25 12:34:48 UTC
Adapted the summery.
Comment 6 JSR_LibreOffice 2019-08-25 15:12:32 UTC
Interesting.

I have created more than 260 figures (did not count all created figures after 1997) to be used in Word (.doc) documents.

At the moment there are no problems with other figures (>260) and they are displayed correctly on LibreOffice Writer documents.

I know that Word 97 is an old program, but the many figures have been created long before OpenOffice and LibreOffice (some figures are created after 1997).

Therefore copying figures from Word (.doc) files to LibreOffice Writer files (.odt) is so important even today.

I had a similar problem with OpenOffice and I reported a bug report then.

I checked that OpenOffice bug with LibreOffice 6.2.6.2 and this time there was not a problem.

May be I was unclear with previous texts.

This was my first LibreOffice Writer bug report and I did not remember all details with bug reporting.
Comment 7 Regina Henschel 2019-08-25 15:40:01 UTC
It has nothing to do with Word at all. The image itself makes the problem. In the image file I see "Exported by ABC Flowcharter 3.0 - Micrografx, Inc".
Comment 8 JSR_LibreOffice 2019-08-25 17:10:41 UTC
Interesting again.

I checked this with with Calligra Words 2.9.6.

https://www.calligra.org/get-calligra/


With Calligra Words 2.9.6. the figure is presented correctly when compared to the original (Word 97) word file (.doc).

Also the PDF file from Calligra Words 2.9.6.is exported correctly when compared to the original (Word 97) word file (.doc).


I add the files after this comment:

1) the view from Calligra Words 2.9.6.
2) and the exported PDF file by Calligra Words 2.9.6.



Calligra Words 2.9.6. was created on 2015.

Interesting issue after all.
Comment 9 JSR_LibreOffice 2019-08-25 17:11:45 UTC
Created attachment 153644 [details]
the view from Calligra Words 2.9.6.


Here is the view from Calligra Words 2.9.6.

The figure is correct when compared to the original Word file (.doc).
Comment 10 JSR_LibreOffice 2019-08-25 17:12:55 UTC
Created attachment 153645 [details]
the exported PDF file by Calligra Words 2.9.6.

Here is the exported PDF file by Calligra Words 2.9.6.

The PDF file is created correctly when compared to original Word file (.doc).
Comment 11 JSR_LibreOffice 2019-08-26 09:15:25 UTC
I continued testing this with another programs with my LINUX desktop.

AbiWord had problems with displaying the figure.
Latest version of AbiWord is dated 20 October 2016.


For comparison reasons I installed WPS Office in LINUX desktop.
Installed WPS Office for LINUX is version 11.1.0.8392 (i386) created on 15 April 2019.

http://wps-community.org/downloads

There are new versions of WPS Office in LINUX but they are 64-bit versions and my laptop is 32-bit LINUX .


Then information about tests.

1)
The view on WPS Writer displays the figure correctly.

The view on WPS Writer will be added after this comment.

2)
Then I saved that in Word (.doc) document.
When opened in LibreOffice the figure was not correct.

That Word (.doc) document will be added after this comment.

3)
Then I exported a PDF file from WPS Writer.
Exported PDF file displays the figure correctly.

That PDF document will be added after this comment.

4)
When summarizing this issue it seems that there are some differences between different programs.

Some programs display the figure correctly and some programs seem to have problems with the figure.


Interesting issue after all.
Comment 12 JSR_LibreOffice 2019-08-26 09:16:31 UTC
Created attachment 153653 [details]
The view on WPS Writer displays the figure correctly.



The view on WPS Writer displays the figure correctly.
Comment 13 JSR_LibreOffice 2019-08-26 09:17:31 UTC
Created attachment 153654 [details]
Word (.doc) document created with WPS Writer



Word (.doc) document created with WPS Writer.
Comment 14 JSR_LibreOffice 2019-08-26 09:18:29 UTC
Created attachment 153655 [details]
Exported PDF from WPS Writer file displays the figure correctly.



Exported PDF from WPS Writer file displays the figure correctly.
Comment 15 JSR_LibreOffice 2019-08-28 08:30:37 UTC
Created attachment 153698 [details]
Here is more information about this bug.


Here is more information about this bug.

This time I added all test files to one ZIP file – download that ZIP file.


First file is named as “NEW_1_Word_(97)_doc_file.doc”.

This file (NEW_1_Word_(97)_doc_file.doc) contains three figures
One figure is used previously with this bug.

There are now two new figures which have problems with LibreOffice.


Second file is named as “New_2_view_from_Word_97_doc_file.PNG”.
This file presenting figures as they are seen in Word 97 (.doc).


Third file is named as “New_3_view_from_LibreOffice_doc_file.PNG”.
This file is presenting figures as they are in LibreOffice – used version is 6.2.6.2 (x64).
Like the figure indicates figures are not presented correctly when compared to previous figure.


For comparison reasons there is fourth figure named as “New_4_view_from_WPS_Office.png”.
This file is presenting figures in WPS Office.


Like the fourth figure indicates these three figures from the first Word file (.doc) are presented correctly in WPS Office when compared to LibreOffice.
Comment 16 Bartosz 2021-03-22 16:07:32 UTC
Hello Jukka.
Do you know how the original document was created?
Is it created with Office 97?
Comment 17 JSR_LibreOffice 2021-03-22 17:09:10 UTC
Hi,

Yes.
It is created with Microsoft Word 97 SR-1.
Comment 18 JSR_LibreOffice 2021-03-22 18:35:18 UTC
Hi again.

Important addition.

Comment 15 contains all necessary information.

Files (Comment 15) there contains more figures than the original document.

All figures (Comment 15) have some problems with LibreOffice.
Comment 19 Bartosz 2021-03-23 13:54:47 UTC
Thanks. Do you have still access to Word 97?

Is it will be possible for you to create minimal version of WMF file?
Comment 20 JSR_LibreOffice 2021-03-23 17:18:24 UTC
Hi,

What do you mean?

A DOC document with one image?
Comment 21 Bartosz 2021-03-24 10:51:12 UTC
> A DOC document with one image?

I mean doc with one wmf image, and this image should cointain single Rounded Rectangle. I will drastically simplify analysing process.

From my initial analysis, it seems that drawing META_ROUNDRECT Record is not implemented correctly:
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/9c262e3b-e631-4343-8b90-0441872f1e9a

The pen width is controlled by META_CREATEPENINDIRECT Record:
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/bdb95c1f-c3e7-41cf-8b56-879c6f3441c3
Comment 22 JSR_LibreOffice 2021-03-24 11:46:15 UTC
Created attachment 170692 [details]
DOC file - only one figure

Hi again,

I attached the ZIP file here.

The first document is named "1_LibreOffice_test_only_one_figure.doc".
This is a DOC file with one figure.

The second document is named "2_LibreOffice_test_only_one_figure.PNG".
This document shows how the figure is displayed with Word 97 SR-1.

The third document in named "3_LibreOffice_test_only_one_figure".
This document shows how the figure is displayed with LibreOffice (7.0.5.2 (x64)).
Comment 23 Bartosz 2021-03-24 14:59:24 UTC
Created attachment 170706 [details]
Minimal WMF file, on which the issue is reproducible
Comment 24 JSR_LibreOffice 2021-03-26 10:20:24 UTC
I am not familiar with WMF files.

I opened your WMF file with Draw.

It seemed that the lines were very thin when compared to the original image on the DOC file with thicker lines.
Comment 25 Xisco Faulí 2021-05-21 17:07:19 UTC
(In reply to Bartosz from comment #23)
> Created attachment 170706 [details]
> Minimal WMF file, on which the issue is reproducible

Hi Bartosz,
I'm not sure why you closed this issue as RESOLVED FIXED but the minimal document is still reproducible in

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: 4e4e02904fdff021631e7758a277b7c1c7b9378a
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 26 Xisco Faulí 2021-05-21 17:07:41 UTC
Created attachment 172235 [details]
Comparison LibreOffice 7.2 master and  MSO 2010
Comment 27 Commit Notification 2021-05-22 08:03:38 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

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

tdf#127145 WMF Fix displaying line width in ROUNDRECT record

It will be available in 7.2.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 28 Commit Notification 2021-05-22 11:26:18 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

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

tdf#127145 WMF Fix displaying line width in ROUNDRECT record

It will be available in 7.1.5.

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 29 Xisco Faulí 2021-05-24 09:20:02 UTC
Verified in

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: 42d2b2d55a27f11153ea1713737d93540a19211d
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Bartosz, thanks for fixing this issue!!
Comment 30 JSR_LibreOffice 2021-08-19 10:55:11 UTC
Hi,

This is working well with 7.1.5.2 (x64).