Bug 129244 - FILEOPEN: Blurred EMF image
Summary: FILEOPEN: Blurred EMF image
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0 all versions
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.0.2
Keywords: bibisected, bisected, regression
: 131387 136015 (view as bug list)
Depends on:
Blocks: Regressions-EMFPlus-Rework
  Show dependency treegraph
 
Reported: 2019-12-06 16:09 UTC by Xisco Faulí
Modified: 2024-07-15 08:33 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
How it looks in LibreOffice 6.5 master (8.24 KB, image/png)
2019-12-06 16:09 UTC, Xisco Faulí
Details
another file affected (60.24 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-12-06 16:25 UTC, Xisco Faulí
Details
File converted to .docx file (64.10 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-05-21 15:27 UTC, Bartosz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2019-12-06 16:09:13 UTC
Created attachment 156368 [details]
How it looks in LibreOffice 6.5 master

Steps to reproduce:
1. Open attachment 143005 [details] from bug 118272

-> Both images are blurred

Reproduced in

Version: 6.5.0.0.alpha0+
Build ID: b5a4570e214f0e965a8b32cee3c615856ae07ac4
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

[Bug found by office-interoperability-tools]
Comment 1 Xisco Faulí 2019-12-06 16:11:31 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=b93d0cadb79f6652dec4d29ef20813f1d57cc708

author	Armin Le Grand <Armin.Le.Grand@cib.de>	2017-06-12 19:54:12 +0200
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	2017-07-15 11:01:29 +0200
commit b93d0cadb79f6652dec4d29ef20813f1d57cc708 (patch)
tree f1b2d1ddaeb81c8d777dbf86c2b731e33b80085a
parent 600a2aa24085cb972686b46061f9045785208a9e (diff)
emfplus: use size of image of metafile fallback

Bisected with: bibisect-linux64-6.0

Adding Cc: to 

later on, the issue was fixed by https://cgit.freedesktop.org/libreoffice/core/commit/?id=302af8c2da58719844d22483b65a9fe5b3674684 but the commit was reverted in https://cgit.freedesktop.org/libreoffice/core/commit/?id=83baaec3a087f83d0ad3371d55671d9496771586 due to bug 115967
Comment 2 Xisco Faulí 2019-12-06 16:12:17 UTC
@Bartosz, i thought you might be interested in this issue...
Comment 3 Xisco Faulí 2019-12-06 16:25:57 UTC
Created attachment 156369 [details]
another file affected
Comment 4 Xisco Faulí 2019-12-19 13:06:39 UTC
attachment 53915 [details] from bug 33590 is also affected by this commit....
Comment 5 Xisco Faulí 2019-12-19 13:07:39 UTC
@Chris, I thought you might be interested in this issue...
Comment 6 Xisco Faulí 2020-03-17 14:42:49 UTC
*** Bug 131387 has been marked as a duplicate of this bug. ***
Comment 7 Bartosz 2020-05-21 15:27:07 UTC
Created attachment 161083 [details]
File converted to .docx file
Comment 8 Xisco Faulí 2020-09-01 12:52:57 UTC
*** Bug 136015 has been marked as a duplicate of this bug. ***
Comment 9 Army_bloodcore 2020-12-02 16:38:03 UTC
Not confirm with 6.2.0.3.
Версия: 6.2.0.3
ID сборки: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
Потоков ЦП: 4; ОС:Windows 10.0; Отрисовка ИП: GL; VCL: win; 
Локаль: ru-RU (ru_RU); UI-Language: ru-RU
Calc: threaded
Comment 10 Stéphane Guillou (stragu) 2023-11-07 23:52:03 UTC
Icons look good in 6.0.0.3 (before 302af8c2da58719844d22483b65a9fe5b3674684 was reverted)

Blur reproduced in recent trunk build:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 31fb3045dabdb27d913712f3abcade315e3ea9bd
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 11 Mike Kaganski 2024-07-11 07:24:32 UTC
The problem here is that a *raster* fallback image produced for a vector metafile *using its preferred size*, or - before b93d0cadb79f6652dec4d29ef20813f1d57cc708 - some hardcoded size - is used then to paint by stretching to another size. The original vector image must be painted to the target size instead. The b93d0cadb79f6652dec4d29ef20813f1d57cc708 itself didn't regress here, it's just a coincidence that random hardcoded value matched *a given case* better than the preferred size recorded in the metafile. Resize the icons to something that matches the "preferred size" in the metafile, and suddenly the display after that change would become better than before the change.
Comment 12 Mike Kaganski 2024-07-12 05:24:48 UTC
https://gerrit.libreoffice.org/c/core/+/170391
Comment 13 Commit Notification 2024-07-12 10:07:29 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#129244: Let ImpGraphic update its buffer for new pixel sizes

It will be available in 25.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 14 Commit Notification 2024-07-12 12:15:49 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/410da49f0116dc76f9b8438af8109501e8a9dcd4

tdf#129244: fix thinko

It will be available in 25.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 15 Commit Notification 2024-07-15 08:33:27 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/9be647f4588c6fb845ae3bc8ff148b64f8d34924

tdf#129244: Let ImpGraphic update its buffer for new pixel sizes

It will be available in 24.8.0.2.

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 16 Commit Notification 2024-07-15 08:33:29 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#129244: fix thinko

It will be available in 24.8.0.2.

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.