Bug 153008 - FILEOPEN PPTX: images (clipped against a shape) appear horizontally compressed
Summary: FILEOPEN PPTX: images (clipped against a shape) appear horizontally compressed
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.1.3.2 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:24.2.0 target:7.6.1 target:24....
Keywords: bibisected, bisected
: 156663 (view as bug list)
Depends on:
Blocks: PPTX-Images
  Show dependency treegraph
 
Reported: 2023-01-13 16:51 UTC by Gerald Pfeifer
Modified: 2024-09-25 00:40 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample slide (PPTX) (7.99 MB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2023-01-13 16:51 UTC, Gerald Pfeifer
Details
Visual comparison Impress (left) vs PowerPoint (right) (2.91 MB, image/png)
2023-01-13 17:22 UTC, Gerald Pfeifer
Details
My Sample PPTX file with problem (4.22 MB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2023-08-22 15:59 UTC, Jeremy
Details
PDF of My Sample produced from Powerpoint Viewer, showing what I expect (7.71 MB, application/pdf)
2023-08-22 16:07 UTC, Jeremy
Details
Original sample file in LibreOffice 25.2 master vs PP 2016 (627.12 KB, image/png)
2024-09-05 12:31 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer 2023-01-13 16:51:36 UTC
Created attachment 184636 [details]
Sample slide (PPTX)

This sample slide has three images that are clipped (against a shape).
When opened in Impress all three appear horizontally compressed.

This may or may not be related to 
 bug#147704 FILEOPEN PPTX: image appears vertically compressed (by a factor of two)
 bug#138455 - FILEOPEN DOCX OLE objects replacement image horizontally shrunk 

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5b3fd1af1247d4096451e5a768c3438fbccec2b2
CPU threads: 8; OS: Linux 6.0; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US

and all the way back to LibreOffice 7.1

LibreOffice 7.0 does *not* exhibit this horizontal crush, but also do not
do the clipping against a shape. I guess this speaks to an implementation
error in the clipping functionality.
Comment 1 Gerald Pfeifer 2023-01-13 17:22:44 UTC
Created attachment 184639 [details]
Visual comparison Impress (left) vs PowerPoint (right)
Comment 2 Aron Budea 2023-01-13 21:35:33 UTC
Confirmed using LO 7.6.0.0.alpha0+ (d993327eab0a2c9c8820c6528075b01de68b0ec6) / Ubuntu.

The mentioned change comes from bug 140714 's fix, as found by reverse bibisecting it.
Comment 3 Mike Kaganski 2023-08-15 11:58:53 UTC
https://gerrit.libreoffice.org/c/core/+/155717
Comment 4 Commit Notification 2023-08-15 14:46:02 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6c06c8a2be3d8cbbcb8ab1aaaeb04db95114dfcb

tdf#153008: srcRect may have some members negative

It will be available in 24.2.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 5 BogdanB 2023-08-15 15:59:24 UTC
Thanks, Mike and Gerald.

Verified with
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6c06c8a2be3d8cbbcb8ab1aaaeb04db95114dfcb
CPU threads: 16; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

Was bad in (for comparison)
Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 16; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 6 Commit Notification 2023-08-16 09:18:01 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#153008: srcRect may have some members negative

It will be available in 7.6.1.

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 7 Mike Kaganski 2023-08-18 06:55:37 UTC
*** Bug 156663 has been marked as a duplicate of this bug. ***
Comment 8 Jeremy 2023-08-19 16:41:21 UTC
I also have this problem as I reported under bug#134210 Comment 3 of 2020-09-03 22:52:43 UTC.

Now running Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: threaded

Will try daily build when I get chance
Comment 9 Jeremy 2023-08-22 15:59:44 UTC
Created attachment 189099 [details]
My Sample PPTX file with problem

Apart from 3 original slides ith problem, also 2 slides with shape moved to centre of slide (also have problem), and a couple with just the base images (no crop or shape)
Comment 10 Jeremy 2023-08-22 16:07:29 UTC
Created attachment 189100 [details]
PDF of My Sample produced from Powerpoint Viewer, showing what I expect
Comment 11 Jeremy 2023-08-22 16:12:35 UTC Comment hidden (off-topic)
Comment 12 Commit Notification 2024-06-05 14:57:06 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/367ba88092fbc0ba06a7f77157cd012ff0fe3caf

Related: tdf#153008 bump XFillBmpPosOffsetXItem to sal_Int32

It will be available in 24.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 13 Commit Notification 2024-06-06 08:03:21 UTC
Attila Szűcs committed a patch related to this issue.
It has been pushed to "master":

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

tdf#153008 svx: impl crop for stretched bitmap fill

It will be available in 24.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 14 Xisco Faulí 2024-09-05 12:29:06 UTC
(In reply to Commit Notification from comment #13)
> Attila Szűcs committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/commit/
> c30c1d12f283e75fdcc5bb508a79a9d33a431d28
> 
> tdf#153008 svx: impl crop for stretched bitmap fill
> 
> It will be available in 24.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.

This patch even makes the original report to be displayed incorrectly...
Comment 15 Xisco Faulí 2024-09-05 12:31:25 UTC
Created attachment 196248 [details]
Original sample file in LibreOffice 25.2 master vs PP 2016
Comment 16 Xisco Faulí 2024-09-05 12:49:52 UTC
I don't know why but c30c1d12f283e75fdcc5bb508a79a9d33a431d28 was supposed to fix 95165 and not this issue. This issue was already fixed by 6c06c8a2be3d8cbbcb8ab1aaaeb04db95114dfcb. I don't know why this issue was mentioned in c30c1d12f283e75fdcc5bb508a79a9d33a431d28 but it broke the original report as mentioned before.
I'm going to revert it for now, considering tdf#161724 and its duplicated.
For further discussion, please use bug 95165. I uploaded attachment 196251 [details] with different images
Comment 17 Xisco Faulí 2024-09-05 12:50:53 UTC
Revert: https://gerrit.libreoffice.org/c/core/+/172913
Comment 18 Commit Notification 2024-09-05 14:18:28 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/295e1039649de030babf3ac9235cc80f9b9ca33c

tdf#161724: Revert "tdf#153008 svx: impl crop for stretched bitmap fill"

It will be available in 25.2.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 19 Gabor Kelemen (allotropia) 2024-09-05 18:43:26 UTC
Reopening due to revert.
Comment 20 Mike Kaganski 2024-09-05 18:48:05 UTC
(In reply to Gabor Kelemen (allotropia) from comment #19)
> Reopening due to revert.

Err... but IIRC, the fix was in comment 4?
Comment 21 Gerald Pfeifer 2024-09-05 19:16:30 UTC
Yes, as the original reporter this was happily resolved for me - until
the 2024-06-06 commit which came out of the blue a year later.

So I would indeed close this as VERIFIED FIXED - latest after a test
with the original test case.
Comment 22 Xisco Faulí 2024-09-06 07:46:47 UTC
(In reply to Gabor Kelemen (allotropia) from comment #19)
> Reopening due to revert.

See comment 16
Comment 23 Commit Notification 2024-09-06 10:43:18 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-24-8-1":

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

tdf#161724: Revert "tdf#153008 svx: impl crop for stretched bitmap fill"

It will be available in 24.8.1.

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 24 Commit Notification 2024-09-06 11:19:28 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/8fdb6449f9f991ae1eae4a5742081986014de7cd

tdf#161724: Revert "tdf#153008 svx: impl crop for stretched bitmap fill"

It will be available in 24.8.2.

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 25 Aron Budea 2024-09-07 01:35:34 UTC
(In reply to Gerald Pfeifer from comment #21)
> Yes, as the original reporter this was happily resolved for me - until
> the 2024-06-06 commit which came out of the blue a year later.
Attila's commit from 2024-06-06 was supposed to fix Jeremy's case in attachment 189099 [details]. It's unfortunate the change caused the original sample to regress.
Comment 26 Attila Szűcs 2024-09-25 00:40:04 UTC
Sorry for the regression, I really worked only on the 2. bug of this ticket... and that bug should be a separate bug from the 1. one..
i debugged what happening and it seems a bit worse i thought...

the good vs bad xml:
bad:
<p:pic>
	<p:blipFill rotWithShape="1">
		<a:srcRect l="44198" r="1196" b="-1"/>
		<a:stretch/>

good:
<p:sp>
	<p:spPr>
		<a:blipFill>
			<a:srcRect/>
			<a:stretch>
				<a:fillRect l="20048" t="23753" r="-40072" b="-2983"/>
			</a:stretch>

This is the 2 very different case: 
<a:srcRect ..>
<a:fillRect ..>

And they both sent into PROP_GraphicCrop!! (it is not my patch it was like this from long ago) .. althought they are different kind of crops.. and i did not seen any property around it that would tell where it came from.

In my patch, i implemented a missing crop like calculation ... but unfortunatelly it now executed on <a:srcRect ..> case as well, where it should not.

So i think to fix it..
a) the 2 different crop like things should be separated.. they should be stored in 2 different property..
or
b) at least, it would be good to have an additional property that show which crop is stored in PROP_GraphicCrop.. so i could choose to do my calculation or not...