Bug 156411 - Width and Height fields of the Compress dialog don't keep aspect ratio, reset to default value (GTK3)
Summary: Width and Height fields of the Compress dialog don't keep aspect ratio, reset...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:24.2.0 target:7.6.1 target:7.5.6
Keywords: bibisected, bisected, regression
Depends on:
Blocks: GTK3 Image-Compression-Dialog
  Show dependency treegraph
 
Reported: 2023-07-21 09:58 UTC by Stéphane Guillou (stragu)
Modified: 2023-08-09 12:34 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2023-07-21 09:58:02 UTC
Changing the width or height value in the Compress Image dialog resets the other field to its original value instead of updating it to keep the aspect ratio of the image.

Steps to reproduce:
1. Open Writer
2. Insert raster image
3. Image context menu > Compress
4. Change either the width or height value

Reproduced in recent master build:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 77fca616e0bd79e0b405fd0b3543cf8e94e15df3
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

gen VCL not affected.

Note that testing with deb release binaries, 6.1 uses GTK2 by default so won't reproduce the bug.
However, using the linux-64-6.1 bibisect repo, the builds use gtk3 and one can bibisect the issue to the first bad commit 6edb5859f11eb102864795d4d46c8175ab9b06cb which points to core commit:

commit cc7cb945846e5b476de917bb90976a4fca175ad1
author	Caolán McNamara Wed Apr 18 21:06:08 2018 +0100
committer	Caolán McNamara Thu Apr 19 09:53:55 2018 +0200
weld CompressGraphicsDialog
Reviewed-on: https://gerrit.libreoffice.org/53125

Caolán, can you please have a look?
Comment 1 Caolán McNamara 2023-07-25 20:28:45 UTC
We're listening to Entry::changed here, but querying the value, and the value doesn't change when the content changes, only after the spinbutton updates which is typically on losing focus so the old value is what is returned.

What we do everywhere else is listen to SpinButton::value_changed, so I'll make that change here which should make this work consistently with everything else.
Comment 2 Commit Notification 2023-07-26 09:26:37 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#156411 listen to "value-changed" not "changed"

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 3 Commit Notification 2023-07-27 11:38:50 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/6057cc1df797b980f3d1d917befcb3256f3a9fb6

Resolves: tdf#156411 listen to "value-changed" not "changed"

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 4 Commit Notification 2023-08-07 08:48:03 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/254be6a8192ef5c8a00cc75fb216ff535605325f

Resolves: tdf#156411 listen to "value-changed" not "changed"

It will be available in 7.5.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 5 Stéphane Guillou (stragu) 2023-08-09 12:34:59 UTC
Thank you, Caolán!
Fix verified in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 42364fbfafaa95773c073cc080142b64ec1786fb
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded