Bug 162062 - image contours for wrapping text around doesn't work any more
Summary: image contours for wrapping text around doesn't work any more
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.5.2 release
Hardware: All All
: medium normal
Assignee: Patrick (volunteer)
URL:
Whiteboard: target:25.2.0 target:24.8.0.2 target:...
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2024-07-16 20:12 UTC by Paolo Benvenuto
Modified: 2024-08-14 19:33 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
document where the image countour doesn't work (110.34 KB, application/vnd.oasis.opendocument.text)
2024-07-16 20:13 UTC, Paolo Benvenuto
Details
Snapshot of attachment #195339 with after fix (74.63 KB, image/jpeg)
2024-07-17 21:38 UTC, Patrick (volunteer)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Benvenuto 2024-07-16 20:12:55 UTC
Description:
Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: es-DO (C.UTF-8); UI: en-US
Ubuntu package version: 4:24.2.5~rc2-0ubuntu0.24.04.1~lo1
Calc: threaded

Before v 24, inserting an image and setting the countour mode worked properly

Now, no countour is generated for the image: the text doesn't follow the countour of the image any more.

Steps to Reproduce:
1. open the attacched document
2. the image in the 1st page: verify that it has the wrap countour set but no countour is followed

Actual Results:
text doesn't follow the image countour

Expected Results:
text should follow the image countour


Reproducible: Always


User Profile Reset: Yes

Additional Info:
ok
Comment 1 Paolo Benvenuto 2024-07-16 20:13:59 UTC
Created attachment 195339 [details]
document where the image countour doesn't work

the image in the 1st page has the wrap countour setting, but no contour is followed
Comment 2 Mike Kaganski 2024-07-16 20:45:01 UTC
To test:

1. Right-click the image, and choose Wrap->Edit Contour;
2. In the dialog, click AutoContour button.

This used to work in 7.6, but doesn't in 24.2.0.3, but does nothing in 24.8.0.1.
Comment 3 Mike Kaganski 2024-07-16 20:45:39 UTC
(In reply to Mike Kaganski from comment #2)
> This used to work in 7.6, but doesn't in 24.2.0.3, but does nothing in
> 24.8.0.1.

I meant, it worked in 24.2.0.3. It regressed later.
Comment 4 Paolo Benvenuto 2024-07-16 22:48:22 UTC
> I meant, it worked in 24.2.0.3

So the regression is between 24.2.0.3 and 24.2.5.2
Comment 5 Mike Kaganski 2024-07-17 00:42:56 UTC
Regression after commit 1ac602f6ccd75f3b79d6c7a9d40e64677dd5741a (tdf#161498 use COL_ALPHA_OPAQUE for finding opaque pixels, 2024-06-07). But this is not tdf#161833, because it is not fixed in today's master.
Comment 6 Stéphane Guillou (stragu) 2024-07-17 04:25:06 UTC
(In reply to Mike Kaganski from comment #5)
> Regression after commit 1ac602f6ccd75f3b79d6c7a9d40e64677dd5741a
Confirmed with linux-64-24.8 bibisect repo (cherrypick bed03b80139322dc361291eed76345acc8be9e5c which is build [c061fcb6ae198147e39682df2f79e13ac2318e2f]).

To see the difference, on the page 1 image:

Wrap > Contour > off
Wrap > Contour > on

Patrick, can you please have a look?
Comment 7 Patrick (volunteer) 2024-07-17 11:55:33 UTC
I can reproduce this bug in my local build. Looks like the image is an 8-bit grayscale image so I'll try excluding 8-bit images from my fix for tdf#161498.
Comment 8 Paolo Benvenuto 2024-07-17 12:16:50 UTC
> I'll try excluding 8-bit images from my fix

Actually the bug affects all images. I can confirm it with a jpg photo edited with gimp so that it has shaped contours
Comment 9 Paolo Benvenuto 2024-07-17 12:20:06 UTC
> Actually the bug affects all images. I can confirm it with a jpg photo edited with gimp so that it has shaped contours

No, not all. Not png images with transparency

> I'll try excluding 8-bit images from my fix for tdf#161498.

What about limiting that fix to images with transparency?
Comment 10 Patrick (volunteer) 2024-07-17 12:50:39 UTC
I think I have found the cause of the problem. I have submitted a fix in the following patch but I'd lot someone else to review and/or test it on their machine before I commit it.

https://gerrit.libreoffice.org/c/core/+/170627
Comment 11 Commit Notification 2024-07-17 19:37:03 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

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

tdf#162062 only apply fix for tdf#161833 if there is a palette

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 12 Patrick (volunteer) 2024-07-17 19:46:02 UTC
OK. I changed my mind and decided to commit my fix for this bug. I only have a small set of images to test with so  so that 

@Paolo The fix should be in tomorrow's (18 July 2024) nightly master builds. Can you install tomorrow's nightly master build and see if the fix works with your documents? If the fix works, I will then submit it for inclusion in the next Libreoffice 24.2 version:

https://dev-builds.libreoffice.org/daily/master/current.html

Note: the nightly master builds install as LibreOfficeDev so they don't overwrite any existing LibreOffice official release that you have installed on your machine.
Comment 13 Paolo Benvenuto 2024-07-17 21:01:39 UTC
@Paolo Can you install tomorrow's nightly master build and see if the fix works with your documents?

@Patrick Unfortunatly I cannot. I'm in a country where the internet connection is very very very slow, and it's impossible even only to think to download LO nightly build.

Could you load my attacchment https://bugs.documentfoundation.org/attachment.cgi?id=195339 and see whether the countour works or not?
Comment 14 Patrick (volunteer) 2024-07-17 21:30:24 UTC
(In reply to Paolo Benvenuto from comment #13)
> Could you load my attacchment
> https://bugs.documentfoundation.org/attachment.cgi?id=195339 and see whether
> the countour works or not?

I already did that and the fix works for me on my Mac. I used your attached document to debug what values in the code were different in your image compared to the image in tdf#161833.

I was just being cautious and hoping that you could test my fix against any other documents that are also affected by this bug.

I will go ahead and submit the fix for inclusion the next version of LibreOffice 24.2 and for the upcoming LibreOffice 24.8 as well.

In the meantime, can anyone else verify my fix on Windows and/or Linux?
Comment 15 Patrick (volunteer) 2024-07-17 21:38:56 UTC
Created attachment 195364 [details]
Snapshot of attachment #195339 [details] with after fix
Comment 16 Stéphane Guillou (stragu) 2024-07-18 02:27:45 UTC
(In reply to Patrick Luby (volunteer) from comment #14)
> In the meantime, can anyone else verify my fix on Windows and/or Linux?
Fix verified on Linux with my own local build that includes your patch. Thanks Patrick!
Comment 17 Paolo Benvenuto 2024-07-18 13:20:15 UTC
Thank you Patrick!

Will the patched be backported to 24.2?
Comment 18 Patrick (volunteer) 2024-07-18 14:04:46 UTC
(In reply to Paolo Benvenuto from comment #17)
> Thank you Patrick!
> 
> Will the patched be backported to 24.2?

I hope so. I have submitted the following patch for LibreOffice 24.2:

https://gerrit.libreoffice.org/c/core/+/170655

Since LibreOffice 24.2 is already an official release, changes require a "+1" vote from 3 developers so my patch has not been committed yet. But I am hopeful that it will get enough votes to be included in LibreOffice 24.2.6 which is scheduled to be released at the beginning of September 2024.
Comment 19 Commit Notification 2024-07-23 12:01:32 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/69e84cd448e359bf63ead6ed647c380b6ddc2c6c

tdf#162062 only apply fix for tdf#161833 if there is a palette

It will be available in 24.8.0.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 20 Commit Notification 2024-07-26 23:57:02 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/796a3e836e5c2379b22e6b73aba5986f406d8c38

tdf#162062 only apply fix for tdf#161833 if there is a palette

It will be available in 24.2.6.

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 21 Paolo Benvenuto 2024-08-14 19:33:22 UTC
fix confirmed with LibreOfficeDev_24.2.6.0.0