Bug 145873 - FILEOPEN: EMF file not displayed
Summary: FILEOPEN: EMF file not displayed
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: All All
: high major
Assignee: Hossein
URL:
Whiteboard: target:7.3.0 target:7.4.0 target:7.3....
Keywords: bibisected, bisected, regression
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
 
Reported: 2021-11-24 15:53 UTC by Xisco Faulí
Modified: 2021-12-01 12:50 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Comparison LibreOffice 7.3 master and MSO 2010 (165.38 KB, image/png)
2021-11-24 15:53 UTC, Xisco Faulí
Details
Extracted EMF file (2.48 MB, image/emf)
2021-11-24 21:38 UTC, Bartosz
Details
Extracted EMF image from attachment 80471 (3.98 KB, image/wmf)
2021-11-24 22:42 UTC, Bartosz
Details
minimized reproducer (51.12 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2021-11-25 10:28 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2021-11-24 15:53:22 UTC
Created attachment 176474 [details]
Comparison LibreOffice 7.3 master and  MSO 2010

Steps to reproduce:
1. Open attachment 39616 [details] from bug 30721

-> Image on the left is not displayed. See comparison image

Reproduced in

Version: 7.3.0.0.alpha1+ / LibreOffice Community
Build ID: becd76743fd7a3ae84404f26b1afb60b923cabb2
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

[Bug found by office-interoperability-tools]
Comment 1 Xisco Faulí 2021-11-24 15:54:32 UTC
Regression introduced by:

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

author	Hossein <hossein@libreoffice.org>	2021-09-27 06:53:47 +0200
committer	Hossein <hossein@libreoffice.org>	2021-09-27 22:08:15 +0200
commit 5e4e1cdb1e14354b42838e1dfcf82873b3071896 (patch)
tree f1d10dbf6d1f9ad302c6b505e1c5ed126fcce635
parent fc5856263439846c9e692e1ccaddf3312530b1a2 (diff)
tdf#88163 Fix font size for placeable wmf files

Bisected with: bibisect-linux64-7.3

Adding Cc: to Hossein
Comment 2 Xisco Faulí 2021-11-24 16:09:50 UTC
attachment 80471 [details] from bug 65504 is also affected by this issue. Formulas in slide 2 are not displayed
Comment 3 Bartosz 2021-11-24 21:38:42 UTC
Created attachment 176480 [details]
Extracted EMF file
Comment 4 Bartosz 2021-11-24 22:42:20 UTC
Created attachment 176481 [details]
Extracted EMF image from attachment 80471 [details]

It seems that regression is inside EMF files, but changes made by Hossein is only in WMF import:

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

https://git.libreoffice.org/core/+/d25906087918c085239aac30fd72cb65aa7b9eb4%5E%21
Comment 5 Hossein 2021-11-25 00:04:09 UTC
Comment on attachment 176480 [details]
Extracted EMF file

This is an EMF file, and not a WMF.

$ file tdf145873-image
tdf145873-image: Windows Enhanced Metafile (EMF) image data version 0x10000
Comment 6 Hossein 2021-11-25 00:05:49 UTC
(In reply to Bartosz from comment #4)
> Created attachment 176481 [details]
> Extracted EMF image from attachment 80471 [details]
> 
> It seems that regression is inside EMF files, but changes made by Hossein is
> only in WMF import:
> 
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=5e4e1cdb1e14354b42838e1dfcf82873b3071896
> 
> https://git.libreoffice.org/core/+/
> d25906087918c085239aac30fd72cb65aa7b9eb4%5E%21
EMF can have WMF embedded inside it. The attachment 176480 [details] is an EMF consisting of several "GDIcomment" records in which one of them (with index 5) embeds a Placeable WMF file without some records related to the size of the WMF. It reaches pStm->SetError( SVSTREAM_FILEFORMAT_ERROR ); in emfio/source/reader/wmfreader.cxx:1982 which causes to the problem in loading the file.

I am providing a fix.
Comment 7 Hossein 2021-11-25 02:37:36 UTC Comment hidden (obsolete)
Comment 8 Bartosz 2021-11-25 08:01:04 UTC
@Xisco Where I could find the documents which are tested by `office-interoperability-tools` ?
Comment 9 Xisco Faulí 2021-11-25 10:02:49 UTC
(In reply to Hossein from comment #7)
> @Xisco: How to test weather the EMF file is displayed or not (displayed as
> blank)? Saving in another format like PDF; reloading and then checking the
> size of the file?

I guess you already sorted out in https://gerrit.libreoffice.org/c/core/+/125796 or do you still need help with it ?
Comment 10 Xisco Faulí 2021-11-25 10:07:32 UTC
(In reply to Bartosz from comment #8)
> @Xisco Where I could find the documents which are tested by
> `office-interoperability-tools` ?

The documents are downloaded from different bugzilla trackers using this script < https://github.com/x1sc0/office-interoperability-tools/blob/master/scripts/get-bugzilla-attachments-by-mimetype > which is an adaptation of https://cgit.freedesktop.org/libreoffice/core/tree/bin/get-bugzilla-attachments-by-mimetype
why ?
Comment 11 Xisco Faulí 2021-11-25 10:28:19 UTC
Created attachment 176495 [details]
minimized reproducer
Comment 12 Commit Notification 2021-11-26 12:32:12 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/149bd802623d6d83ec9aa04514b938494f7f01f6

tdf#145873 Fix FILEOPEN: EMF file not displayed

It will be available in 7.3.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 13 Hossein 2021-11-26 15:34:59 UTC
The latest patch partially fixes the problem.
I am sending a follow-up.
Comment 14 Commit Notification 2021-11-30 10:26:19 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/20d5e320801606856c1d05c4f34d9fa82371aac8

tdf#145873 Fix FILEOPEN: EMF file not displayed #2

It will be available in 7.4.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 2021-11-30 10:27:32 UTC
Hossein committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/02643f4c0b77237390f238f22d723fbc9aecc444

tdf#145873 Fix FILEOPEN: EMF file not displayed

It will be available in 7.3.0.0.beta2.

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 2021-11-30 14:20:47 UTC
Hossein committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

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

tdf#145873 Fix FILEOPEN: EMF file not displayed #2

It will be available in 7.3.0.0.beta2.

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 17 Bartosz 2021-12-01 12:50:34 UTC
Verified on:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 20d5e320801606856c1d05c4f34d9fa82371aac8
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: pl-PL (pl_PL.UTF-8); UI: en-US
Calc: threaded