Bug 153241 - FILEOPEN: VmlDrawingsPart .emf embedded images are not shown correctly; elements moved down on Y axis
Summary: FILEOPEN: VmlDrawingsPart .emf embedded images are not shown correctly; eleme...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, filter:ods, regression
Depends on:
Blocks: EMF-WMF XLSX
  Show dependency treegraph
 
Reported: 2023-01-27 11:37 UTC by assk
Modified: 2024-10-27 17:07 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
test results with MS Excel and LO 7.6 alpha0+ (340.50 KB, application/pdf)
2023-01-31 17:18 UTC, Stéphane Guillou (stragu)
Details
XLSX file on which the issue could be reproduced (2.55 MB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2023-09-06 09:32 UTC, Bartosz
Details
XLSX file resaved with LO 7.5.5 (141.62 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2023-09-06 09:39 UTC, Bartosz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description assk 2023-01-27 11:37:31 UTC
Hi

When I use LibreOffice CLI to convert an .xlsx with embedded objects of the type .emf as included in an VmlDrawingsPart to .ods, then these .emf images will not be rendered in the correct spot in LibreOffice when opening the newly created .ods.

The images will be shown in the correct x axis, but 20px or so lower on the y axis.

See two comparison spreadsheets (original.xlsx and conversion.ods) in this Google Drive folder:
https://drive.google.com/drive/folders/1q2-OsLldP9ua6jyuDefBdkllvtM9bISY?usp=sharing
Comment 1 Stéphane Guillou (stragu) 2023-01-27 22:51:19 UTC
Using the command:

libreoffice7.4 --convert-to ods original.xlsx

(But it's the same result as using File > Save as... > ODS, then File > Reload.)

I can see the following elements moved down:

- The top embedded spreadsheet
- The bottom linked spreadsheet
- The top-right embedded image object

Tested with:

Version: 7.4.5.1 / LibreOffice Community
Build ID: 9c0871452b3918c1019dde9bfac75448afc4b57f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Same with slight differences in a recent master build:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 69c6f7bccec838b7288a25a29a83b7f782ba7586
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

But in general, the (parts of) elements moving down / losing their Y axis location when opening the ODS is a regression, as I can reproduce in:

Version: 6.2.0.0.beta1
Build ID: d1b41307be3f8c19fe6f1938cf056e7ff1eb1d18
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); UI-Language: en-US
Calc: threaded

But not in:

Version: 6.1.0.3
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group threaded

This is regardless of what version was used to convert the file, which makes me think its a FILEOPEN issue with ODS.

assk, which part is an EMF? All I can see is PNG and JPG. (The 3D model comes across as a picture.)
Comment 2 Stéphane Guillou (stragu) 2023-01-27 22:56:41 UTC
Note that MS Excel opens the ODS file with the elements at the correct Y position!

Microsoft 365 MSO (Version 2212 Build 16.0.15928.20196) 64-bit
Comment 3 assk 2023-01-31 13:37:55 UTC
When you embed another OOXML package in an OOXML spreadsheet i.e. XLSX using Excelm then Excel will both embed the package and generate a snapshot of the embedded data and save it as an .emf image file in the URI xl/media/

Formally, they are saved as relationships to a WorksheetPart as an ImagePart and to a VmlDrawingsPart.

So these images are not real embedded images by the user, but Excel generated images of an embedded package. They are great to keep, if you want to remove the embedded package but keep the image snapshot of the data.
Comment 4 assk 2023-01-31 13:42:45 UTC
You can find the image controls of these emfs in a file called vmlDrawing1.vml under xl/drawings

These images are represented in drawing1.xml and they do not have Blip image controls.
Comment 5 Buovjaga 2023-01-31 16:21:20 UTC
What I see is that the row height changes from 0,53 cm to 0,49 cm. I see no difference in this regard in 6.1 or 6.2 bibisect repos. Stéphane, can you give more details about this difference you see?
Comment 6 Stéphane Guillou (stragu) 2023-01-31 17:18:53 UTC
Created attachment 185036 [details]
test results with MS Excel and LO 7.6 alpha0+

Attached PDF shows three screenshots:
- Original XLSX displayed in MS Excel
- Original XLSX displayed in LO recent master build
- Saved as ODS and reloaded in LO recent master build

Versions:

Microsoft® Word for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20196) 64-bit 

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ec4babad021218b75dfe8534985d7db525edde69
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 7 Buovjaga 2023-01-31 18:40:26 UTC
I did a bibisect with linux-64-6.0, keeping an eye on the 1 2 3 dropping below the white rectangle with black borders. IMPORTANT: I checked by opening the .ods with 7.4. The file open result is different with older versions.

Result:
https://git.libreoffice.org/core/commit/286c27e805c4501451857abff19c23b3719146a3
tdf#111548: Better fix for PPTX / XLSX import of ActiveX controls

Tamás is no longer active, so I won't bother him with this.
Comment 8 Stéphane Guillou (stragu) 2023-01-31 23:24:22 UTC
Thanks, Ilmari. You're right, what I saw in 6.2 and described at the end of comment 1 was the impact of the famous row height recalculation commit 1e55a47e89a9d9d6cf9cb3993484022aaf2c097b. Sorry about the confusion.

Adding metas but you might be able to think of better ones.
Comment 9 Natasharoy 2023-02-07 16:21:11 UTC Comment hidden (spam)
Comment 10 Natasharoy 2023-02-07 16:22:05 UTC Comment hidden (spam)
Comment 11 Bartosz 2023-09-06 09:32:10 UTC
Created attachment 189382 [details]
XLSX file on which the issue could be reproduced
Comment 12 Bartosz 2023-09-06 09:39:29 UTC
Created attachment 189383 [details]
XLSX file resaved with LO 7.5.5

The issue is reproducible also after resaving it to XLSX with LibreOffice.
Comment 13 asbjoern.skoedt 2024-10-27 17:07:13 UTC
Any news on getting this fixed?