Bug 158535 - Increasing/decreasing the image size while keep ratio checked introduces rounding issues. Changing the absolute image dimensions
Summary: Increasing/decreasing the image size while keep ratio checked introduces roun...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Images
  Show dependency treegraph
 
Reported: 2023-12-05 09:49 UTC by Telesto
Modified: 2025-06-06 13:49 UTC (History)
2 users (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 Telesto 2023-12-05 09:49:38 UTC
Description:
Increasing/decreasing the image size while keep ratio checked introduces rounding issues. Changing the absolute image dimensions

Steps to Reproduce:
1. Open attachment 173542 [details]
2. Select the camera image and press F4 (Image Properties dialog)
3. Go to position and size tab
4. Check 'Keep Ratio' 
5. Take notice of the initial dimensions: 10x7,5cm)
5. Reduce the image height by pressing 3x decrease on the spinbutton (7,20 cm)
6. Increase the image height by pressing 3 increase on the spinbutton (7,50 cm)

Actual Results:
Image width changes to 9,99cm. 

Expected Results:
Image width should be 10 cm again. 


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5682e1d4145c26fc8021879df0543d5aeacf9c83
CPU threads: 8; OS: macOS 13.4.1; UI render: Skia/Raster; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 1 Telesto 2023-12-05 13:58:02 UTC
Apparently the issue is cumulative

1. Open attachment 173542 [details]
2. Select the camera image and press F4 (Image Properties dialog)
3. Go to position and size tab
4. Check 'Keep Ratio' 
5. Take notice of the initial dimensions: 10x7,5cm)
5. Place the cursor in the height box and scroll down to smallest value (0,16 cm)
6. Now scroll height back up to(7,50 cm). Width is now 9,55 cm

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ff3fb42b48c70ba5788507a6177bf0a9f3b50fdb
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded
Comment 2 Telesto 2023-12-05 14:02:48 UTC
Also with 
Versie: 5.2.4.2 
Build ID: 3d5603e1122f0f102b62521720ab13a38a4e0eb0
CPU Threads: 4; Versie besturingssysteem:Windows 6.2; UI Render: GL; 
Locale: nl-NL (nl_NL); Calc: CL

Except the width only being off by 0,04. So 9,96 cm instead of 10.00 cm


Also in 
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735

The height be off by 0,39 cm: 9,61cm versus 10.00
Comment 3 Rafael Lima 2023-12-08 14:48:06 UTC
Repro as described by the OP in:

Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 60(Build:2)
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 4:7.6.3-0ubuntu0.23.10.1~lo1
Calc: threaded

Also in

Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 07036eea5089feae511145412d7105cb76c1955a
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded
Comment 4 Telesto 2025-06-06 13:49:11 UTC
Created attachment 201103 [details]
Example file

1. Open the attached file
2. Select the shape
3. Press F4 / Open shape properties
4. Position and size tab
5. Check lock ratio
6. Reduce the width by pressing arrow down (keyboard) 10 times. So decreasing width to 39 cm. Width becomes 3,89 cm
7. Increase the width by pressing arrow up (keyboard 10 times). Height becomes 3,98cm