Bug 143127 - FILESAVE DOCX Saving a chart containing an image creates invalid file error in Word
Summary: FILESAVE DOCX Saving a chart containing an image creates invalid file error i...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Balázs Varga
URL:
Whiteboard: target:7.3.0
Keywords: bibisected, bisected, filter:docx
Depends on:
Blocks: OOXML-Chart DOCX-Corrupted
  Show dependency treegraph
 
Reported: 2021-06-30 09:52 UTC by NISZ LibreOffice Team
Modified: 2021-09-08 10:57 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
attachment 120636 saved to DOCX with current nightly (356.82 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-06-30 09:52 UTC, NISZ LibreOffice Team
Details
Screenshot of the original and exported document side by side in Writer (367.27 KB, image/png)
2021-06-30 09:53 UTC, NISZ LibreOffice Team
Details
Screenshot of the exported document in Word (7.43 KB, image/png)
2021-06-30 09:53 UTC, NISZ LibreOffice Team
Details
Excel-made chart with image inserted (67.10 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-08-09 12:45 UTC, NISZ LibreOffice Team
Details
attachment 174152 saved by Calc (60.73 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-08-09 12:45 UTC, NISZ LibreOffice Team
Details
The Excel-made file in Excel, Calc and the Calc-saved version in Calc (199.90 KB, image/png)
2021-08-09 12:51 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2021-06-30 09:52:37 UTC
Created attachment 173282 [details]
attachment 120636 [details] saved to DOCX with current nightly

This is a followup to bug #95918
The example attachment 120636 [details] contains a chart that has an image inserted into it.
This opens correctly after bug 138561 was fixed.
However in current master saving the example file to docx creates an invalid file error in Word, and a placeholder in Writer.

Steps to reproduce:
    1. Open attachment 120636 [details] 
    2. Save to DOCX, reopen in Writer and Word

Actual results:
Writer opens the file but instead of the chart area with an image we see a placeholder with the “chart …” text.
Word cannot open the file.

Expected results:
The image placed onto the chart roundtrips correctly when seen in Word/Writer.

LibreOffice details:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 9c15dea0b2192d231b65175291a7655122c2e24c
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: CL

Additional Information:
Bibisected using bibisect-win64-7.2 to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=3184cfc493c6931725dce1de19ac958067b1fd25 
author	Balazs Varga <balazs.varga991@gmail.com>	Fri Dec 11 20:31:28 2020 +0100
committer	László Németh <nemeth@numbertext.org>	Wed Dec 16 16:11:40 2020 +0100

tdf#128621 OOXML Chart: export embedded shapes in chart

Adding CC to:  Balazs Varga
Comment 1 NISZ LibreOffice Team 2021-06-30 09:53:01 UTC
Created attachment 173283 [details]
Screenshot of the original and exported document side by side in Writer
Comment 2 NISZ LibreOffice Team 2021-06-30 09:53:22 UTC
Created attachment 173284 [details]
Screenshot of the exported document in Word
Comment 3 Xisco Faulí 2021-07-07 10:00:35 UTC
Reproduced in

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: eac5977bfc11797eda356560a5e45c51108ef5a1
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 4 Regina Henschel 2021-07-31 12:38:02 UTC
I do not get an "invalid file error" in Excel, but the image is missing. The image is missing too, if I start with an .ods file and save that to .xlsx
Comment 5 NISZ LibreOffice Team 2021-08-09 12:45:00 UTC
Created attachment 174152 [details]
Excel-made chart with image inserted

XLSX export breaks too, indeed:

Version: 7.3.0.0.alpha0+ (x86) / LibreOffice Community
Build ID: 41f1d389d4b513a7f616542d00fd58268ab5ea07
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

Thanks for pointing out!
Comment 6 NISZ LibreOffice Team 2021-08-09 12:45:38 UTC
Created attachment 174153 [details]
attachment  174152 [details] saved by Calc
Comment 7 NISZ LibreOffice Team 2021-08-09 12:51:43 UTC
Created attachment 174154 [details]
The Excel-made file in Excel, Calc and the Calc-saved version in Calc

Also when comparing the xml with László's odiff tool, I got this xmllint warning:

./xl/drawings/drawing2.xml:2: namespace error : Namespace prefix r for embed on blip is not defined
""></cdr:cNvPr><cdr:cNvPicPr/></cdr:nvPicPr><cdr:blipFill><a:blip r:embed="rId1"
Comment 8 Commit Notification 2021-09-01 08:32:32 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

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

tdf#143127 tdf#143130 ooxml export: fix lost image/shape in chart

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 9 NISZ LibreOffice Team 2021-09-08 10:57:49 UTC
Verified in:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 8151f3a1d99ab740d2affdccc7115faa156bf3ad
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded