Bug 163716 - Missing image when opening DOCX document
Summary: Missing image when opening DOCX document
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, filter:docx
Depends on:
Blocks: DOCX-Images
  Show dependency treegraph
 
Reported: 2024-11-01 14:59 UTC by Mihai Vasiliu
Modified: 2025-01-17 08:43 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
example file (62.39 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-11-01 14:59 UTC, Mihai Vasiliu
Details
Screenshot with the missing image from the table (39.77 KB, image/png)
2024-11-01 14:59 UTC, Mihai Vasiliu
Details
screenshot from MS Office (71.03 KB, image/png)
2024-11-01 15:00 UTC, Mihai Vasiliu
Details
minimal example file (62.02 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-01-16 15:33 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mihai Vasiliu 2024-11-01 14:59:03 UTC
Description:
An image contained in a table is missing when opening the DOCX file.

Steps to Reproduce:
1. Open the attached document. The document contains a vertical table with an image in one of the cells.


Actual Results:
Look at the table and notice that there is no image displayed. There is however a randomly placed image placeholder, but it does not show the image. (see attachments)

Expected Results:
The image should be there.


Reproducible: Always


User Profile Reset: No

Additional Info:
See the attachments with the screenshots from Microsoft office showing the image and from LO which does not show it.
Comment 1 Mihai Vasiliu 2024-11-01 14:59:32 UTC
Created attachment 197337 [details]
example file

Use this to reproduce
Comment 2 Mihai Vasiliu 2024-11-01 14:59:58 UTC
Created attachment 197338 [details]
Screenshot with the missing image from the table
Comment 3 Mihai Vasiliu 2024-11-01 15:00:25 UTC
Created attachment 197339 [details]
screenshot from MS Office
Comment 4 m_a_riosv 2024-11-01 21:31:01 UTC
Reproducible
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 665dce4442e48b133b9fe1a2eb792ed3ef81d90c
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 5 BogdanB 2024-11-02 17:45:33 UTC
In a debug build I egt this lines:
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1852: SvxShape::GetAnyForItem() Return value has wrong Type, string != com.sun.star.awt.XBitmap
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1852: SvxShape::GetAnyForItem() Return value has wrong Type, com.sun.star.awt.Gradient != com.sun.star.awt.Gradient2
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1852: SvxShape::GetAnyForItem() Return value has wrong Type, com.sun.star.awt.Gradient != com.sun.star.awt.Gradient2
warn:svx:7035:7035:svx/source/unodraw/unoshap2.cxx:1481: Getting Graphic by URL is not supported, getting it by value
warn:emfio:7035:7035:emfio/source/reader/wmfreader.cxx:1417: TODO: WMF record not implemented: META_REALIZEPALETTE
warn:emfio:7035:7035:emfio/source/reader/wmfreader.cxx:1417: TODO: WMF record not implemented: META_REALIZEPALETTE
warn:writerfilter:7035:7035:sw/source/writerfilter/dmapper/OLEHandler.cxx:262: OLEHandler::getCLSID: unhandled m_sProgId: AutoCAD.Drawing.15
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1706: DBG_UNHANDLED_EXCEPTION in setPropertyValues exception: com.sun.star.beans.UnknownPropertyException message: "GraphicColorMode at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/svx/source/unodraw/unoshape.cxx:1508" context: SvxCustomShape
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1706: DBG_UNHANDLED_EXCEPTION in setPropertyValues exception: com.sun.star.beans.UnknownPropertyException message: "Representation at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/svx/source/unodraw/unoshape.cxx:1508" context: SvxCustomShape
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1852: SvxShape::GetAnyForItem() Return value has wrong Type, string != com.sun.star.awt.XBitmap
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1852: SvxShape::GetAnyForItem() Return value has wrong Type, com.sun.star.awt.Gradient != com.sun.star.awt.Gradient2
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1852: SvxShape::GetAnyForItem() Return value has wrong Type, com.sun.star.awt.Gradient != com.sun.star.awt.Gradient2
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1706: DBG_UNHANDLED_EXCEPTION in setPropertyValues exception: com.sun.star.beans.UnknownPropertyException message: "Representation at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/svx/source/unodraw/unoshape.cxx:1508" context: SvxShapePolyPolygon
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1852: SvxShape::GetAnyForItem() Return value has wrong Type, string != com.sun.star.awt.XBitmap
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1852: SvxShape::GetAnyForItem() Return value has wrong Type, com.sun.star.awt.Gradient != com.sun.star.awt.Gradient2
warn:svx:7035:7035:svx/source/unodraw/unoshape.cxx:1852: SvxShape::GetAnyForItem() Return value has wrong Type, com.sun.star.awt.Gradient != com.sun.star.awt.Gradient2
warn:legacy.osl:7035:7035:sw/source/core/unocore/unobkm.cxx:157: CreateXBookmark: no MarkBase?
warn:sw.uno:7035:7035:sw/source/core/unocore/unotext.cxx:2300: Exception when setting property: ParaLastLineAdjust com.sun.star.lang.IllegalArgumentException message: "at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/sw/source/core/unocore/unotbl.cxx:2495" ArgumentPosition: 0
warn:sw.uno:7035:7035:sw/source/core/unocore/unotext.cxx:2300: Exception when setting property: CharFontFamily com.sun.star.lang.IllegalArgumentException message: "at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/sw/source/core/unocore/unotbl.cxx:2495" ArgumentPosition: 0
warn:writerfilter:7035:7035:sw/source/writerfilter/dmapper/PropertyMap.cxx:626: Paper source not found com.sun.star.lang.IllegalArgumentException message: "at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/sw/source/core/unocore/unostyle.cxx:1676" ArgumentPosition: 0
warn:legacy.osl:7035:7035:oox/source/helper/storagebase.cxx:67: StorageBase::StorageBase - missing base input stream
warn:sw.core:7035:7035:sw/source/core/text/txtfrm.cxx:537: SwTextFrame::SwitchHorizontalToVertical, IsVertLRBT, not swapped
warn:sw.core:7035:7035:sw/source/core/text/txtfrm.cxx:537: SwTextFrame::SwitchHorizontalToVertical, IsVertLRBT, not swapped
warn:sw.core:7035:7035:sw/source/core/text/txtfrm.cxx:537: SwTextFrame::SwitchHorizontalToVertical, IsVertLRBT, not swapped
warn:sw.core:7035:7035:sw/source/core/text/txtfrm.cxx:537: SwTextFrame::SwitchHorizontalToVertical, IsVertLRBT, not swapped
warn:sw.core:7035:7035:sw/source/core/text/txtfrm.cxx:537: SwTextFrame::SwitchHorizontalToVertical, IsVertLRBT, not swapped
warn:legacy.osl:7035:7035:sw/source/core/txtnode/swfont.cxx:420: Unsupported direction
warn:legacy.osl:7035:7035:sw/source/core/txtnode/swfont.cxx:420: Unsupported direction
warn:legacy.osl:7035:7035:sw/source/core/text/porrst.cxx:362: SwTextFrame::EmptyHeight with swapped frame
warn:legacy.osl:7035:7035:sw/source/core/text/porrst.cxx:362: SwTextFrame::EmptyHeight with swapped frame
warn:legacy.osl:7035:7035:sw/source/core/txtnode/swfont.cxx:420: Unsupported direction
warn:legacy.osl:7035:7035:sw/source/core/txtnode/swfont.cxx:420: Unsupported direction
Comment 6 Gabor Kelemen (allotropia) 2025-01-16 15:03:50 UTC
This used to be almost correctly placed (it was close to the top of the large empty cell, pressed Down arrow and jumped to the correct place) before 6.3 until:

https://git.libreoffice.org/core/+/8fdbda18b593e7014e44a0fd590bbf98d83258b7%5E%21

author	Miklos Vajna <vmiklos@collabora.com>	Fri Feb 15 14:06:15 2019 +0100
committer	Miklos Vajna <vmiklos@collabora.com>	Fri Feb 15 15:05:07 2019 +0100
tree 6f01a202ed9c6b09f0169ec20c7d85f940af143e
parent 3473e1df1fa3483bae68a3c01fdd1b18def99745 [diff]

sw btlr writing mode: implement DOCX filter

Adding Miklos, but not setting regression since it was not really perfect, and maybe just accidentally good-ish.
Comment 7 Gabor Kelemen (allotropia) 2025-01-16 15:33:51 UTC
Created attachment 198579 [details]
minimal example file

If the tables writing direction is changed back to horizontal, the OLE-image becomes visible and correctly placed again.
Comment 8 Miklos Vajna 2025-01-17 08:43:00 UTC
I wonder if this is a case where Writer takes writing mode into account for anchoring purposes, but it should not. Most of the btlr work was about fixing places that didn't go via the SwRectFnCollection abstraction to do the correct action based on the current writing mode. And you hit the above commit because that layout code was not active for opened DOCX files previously. Hmm.