Bug 169680 - FILEOPEN DOCX: images stretched or squeezed
Summary: FILEOPEN DOCX: images stretched or squeezed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:26.8.0 target:25.8.5
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Images
  Show dependency treegraph
 
Reported: 2025-11-25 10:34 UTC by Marcel
Modified: 2025-12-13 12:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of misviewed (by LibreOffice Writer) pictures in Word document (915.76 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-11-25 12:48 UTC, Marcel
Details
Screenshot Word vs Writer (194.02 KB, image/png)
2025-11-25 12:55 UTC, m_a_riosv
Details
New example about the described problem of pictures in Word vs LibreOfficre Writer (3.53 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-11-25 13:14 UTC, Marcel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel 2025-11-25 10:34:49 UTC
Description:
See attachment. Some pictures are visible as they are in MS Word. Some are not visible or are visible in another scale (very big or very small).

Steps to Reproduce:
1.A misviewed picture can be changed by making it bigger or smaller and making use of only a part of the picture (but in MSWord it is automatically viewed in the right way)
2.
3.

Actual Results:
x

Expected Results:
Making a correct view of all pictures as it happens in MS Word when using exactly the same file ....


Reproducible: Always


User Profile Reset: No

Additional Info:
I will add a file using the Add an Attachment link.
Thanks in advance for your attention.
Marcel
Comment 1 m_a_riosv 2025-11-25 11:20:08 UTC
There is no attachment.

Please paste here the information on Menu/Help/About LibreOffice (There is an icon to copy)

Please test in safe mode, Menu/Help/Restart in Safe Mode
Comment 2 Marcel 2025-11-25 12:48:26 UTC
Created attachment 204277 [details]
Example of misviewed (by LibreOffice Writer) pictures in Word document

See bug 169680
Comment 3 m_a_riosv 2025-11-25 12:55:29 UTC
Created attachment 204278 [details]
Screenshot Word vs Writer

I see no difference with what I see in Word.
Comment 4 Marcel 2025-11-25 13:14:16 UTC
Created attachment 204279 [details]
New example about the described problem of pictures in Word vs LibreOfficre Writer
Comment 5 Telesto 2025-11-25 16:34:55 UTC
Confirm. Using attachment 204279 [details]
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d20f7e9b86f2efa258db3e8456dd24d94190e0c5
CPU threads: 8; OS: macOS 14.7.4; UI render: Skia/Raster; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 6 Telesto 2025-11-25 16:38:22 UTC
Most images are less skewed with
Version: 7.0.0.3
Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
CPU threads: 8; OS: Mac OS X 10.16; UI render: default; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 7 Telesto 2025-11-27 00:39:27 UTC
A bibisect might give some clues
Comment 8 Telesto 2025-12-01 19:22:54 UTC
Issue also present in
Version: 6.1.6.3
Build ID: 5896ab1714085361c45cf540f76f60673dd96a72
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: nl-NL (nl_NL); Calc: CL

I'm not seeing any issues with 
Version: 5.4.0.3
Build ID: 7556cbc6811c9d992f4064ab9287069087d7f62c
CPU threads: 4; OS: Windows 6.2; UI render: GL; 
Locale: nl-NL (nl_NL); Calc: CL
Comment 9 Saburo 2025-12-03 07:21:05 UTC
bibisected with linux-64-6.1
commit edda1e5fc8113aa4744e32f97c96a3cc311485ca
author	Miklos Vajna

DOCX import: lazy-read images without external headers

So that similar to ODT, images are not loaded on file open, only when
the user scrolls there.

Notes:

1) GraphicDescriptor::ImpDetectJPG() would try to calculate the logic
size before the pixel size is available, so the logic size would be 0x0.
Also, ImpGraphic::ImplSetPrepared() would always work with a pixel map
mode. Any of these two would result in a failure of
testDMLShapeFillBitmapCrop in CppunitTest_sw_ooxmlexport6.

2) Lazy-loading seems to (at the moment) not recognize EMF files, so
don't lazy-load in case an external header is provided. This probably
has to be revisited, since the ODF import doesn't go via
GraphicProvider::queryGraphic().

Change-Id: I44754e659effebca8339715df114dbaadb9b5e9f
Reviewed-on: https://gerrit.libreoffice.org/53215

***
adding CC: Miklos Vajna
Please, take a look?
Comment 10 Miklos Vajna 2025-12-03 08:06:37 UTC
Thanks for the bisect, I'll try to get to this.
Comment 11 Commit Notification 2025-12-12 14:02:28 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#169680 DOCX import: fix unexpected stretched image

It will be available in 26.8.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 12 Commit Notification 2025-12-12 16:54:54 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

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

tdf#169680 DOCX import: fix unexpected stretched image

It will be available in 25.8.5.

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.