Bug 76991 - Writer destroys aspect ratio when scaling graphics
Summary: Writer destroys aspect ratio when scaling graphics
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Image-Dialog
  Show dependency treegraph
Reported: 2014-04-03 10:50 UTC by Gerry
Modified: 2023-03-27 21:44 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

Strange-aspect-ratio-bug-in-Writer.odt (36.37 KB, application/vnd.oasis.opendocument.text)
2014-04-03 10:50 UTC, Gerry

Note You need to log in before you can comment on or make changes to this bug.
Description Gerry 2014-04-03 10:50:30 UTC
Created attachment 96837 [details]

Writer destroys the aspect ratio of graphics although "keep ratio" is active.

How to reproduce the bug: 
1. Perform a right mouse click on the graphic in attached document and choose "Picture" and the tab "Type"
2. Check the button "Keep ratio" and for Width check the button "Relative"
3. Decrease the value of the width percentage to any value (e.g. 30%). Click okay. The graphic scales perfectly. No problem here.
4. Now go again to the tab "Type" and increase the width percentage to any value (e.g. 70%). The graphic will now wrongly scale and the aspect ratio is broken. Writer somehow "forgets" to keep the ratio.

The bug does not occur if you do following: before scaling again (step 4) uncheck "Relative" and uncheck "Keep ratio" and then check both buttons again. If you now increase the width percentage again (e.g. to 70%) the graphics scales perfectly. 

This means the problem is there if you scale a graphic the second/third/... time while keeping the buttons "Keep ratio" and "Relative" checked.

I cannot reproduce this bug with png graphics, but jpg and eps graphics are affected.

LibreOffice Version:, Build ID: 410m0(Build:2)
System: Ubuntu 13.04 64-bit Intel, Gnome 3.
Comment 1 Gerry 2014-04-03 11:06:05 UTC
Exactly the same problem described in the bug description seems to affect also scaling of text frames (Insert->Frame)
Comment 2 Gerry 2014-04-11 17:51:50 UTC
Most recent version is also affected by this bug:

Build ID: 882f8a0a489bc99a9e60c7905a60226254cb6ff0
Comment 3 Mike Kaganski 2014-04-20 01:32:35 UTC
REPRODUCIBLE with under Win7x64, and under Ubuntu 13.10 x64 -> NEW.
Also REPRODUCIBLE with OOo 3.3.0 -> setting version accordingly.

Reproducible with PNG images as well.
NOT reproducible if in step 2 of comment 0 you also check "Relative" for Height.
Comment 4 harryparry2011 2014-04-25 21:21:56 UTC
Confirmed under LO V. Build-ID: 882f8a0a489bc99a9e60c7905a60226254cb6ff0
Win7 Home 64bit
Comment 5 Matthias Basler 2014-06-20 11:29:33 UTC
I can confirm this with the sample document and LibO (RC1) on Win7 HP.

I can also reproduce this with the same .jpg file in a blank new document.

I can also reproduce it with a newly created image of the same size (256x194px) with both JPG and PNG version and with own photos. The effect is most obvious for images which are far from quadratic such as this business card.

Um ... given that resizing images is a very common task in a word processing application I personally would give this issue a high priority. I am quite sure I stumbled upon this issue already before (in production use), but back then I thought I had done something wrong.
Comment 6 QA Administrators 2015-07-18 17:44:52 UTC Comment hidden (obsolete)
Comment 7 Matthias Basler 2015-07-19 08:09:32 UTC
Still present in latest LO4.4.4. on Win7 64 Bit.
Tested with both the attached sample document and a blank new document.

The bug only appears if the "Relative" checkbox is set for image width, but *not* for the height. It does not appear if both checkboxes are set.

No apparent change in bug behaviour.
Comment 8 ernestopheles 2015-08-16 20:31:10 UTC
Present in LO 4.4.5 (Linux x86_64).
Comment 9 V Stuart Foote 2015-08-17 04:07:43 UTC
Hey, wait a second.  If you are holding aspect ratio with "Keep ratio" then you would not want to set both a vertical and a horizontal relative size as percentage of paragraph area (height or width).  It would be one or the other.

If you set relative in both dimensions--LibreOffice does the sane thing and simply maintains aspect ratio of "Keep ratio".

Also, with "Keep ratio" off, setting either Horizontal or Vertical Width or Height relative will scale in just that dimension. Distorting the image. But it does not scale to the Paragraph area--rather to the Page inside the margins as set.  While selecting "Entire page" uses a percentage of the full page size edge to edge.

That suggests the "Relative to" fields are simply mislabeled.

Finally setting a specific Width or Height with "Keep ratio" off will stretch in one dimension or the other.

Or, finally with "Keep ratio" off, you can set specific Width and Height and stretch in both dimensions.

So, this all actually seems to behave correctly.
Comment 10 V Stuart Foote 2015-08-17 04:38:50 UTC
OK, reading the test document and OP closer. I do see the weird loss of aspect ratio when the Width relative is adjusted a second time. The first setting is correct, but when a change is made to the Width relative percentage the Height is set to a matching length.

The same occurs setting a Height relative, and adjusting a second time. The first setting is correct, but a change made to the Height relative percentage results in Width set to a matching length.

Suggests there is a logic error in the resize/fixed ratio action--somewhere around here...

Comment 11 QA Administrators 2016-09-20 10:26:24 UTC Comment hidden (obsolete)
Comment 12 Gerry 2016-09-22 15:43:43 UTC
Issue confirmed with Version:
Build-ID: 1:5.1.4-0ubuntu1
Comment 13 QA Administrators 2018-07-21 02:39:31 UTC Comment hidden (obsolete)
Comment 14 Gerry 2018-07-21 08:56:31 UTC
Bug still exists in version:

Build-ID: 1:6.0.5~rc2-0ubuntu0.16.04.1~lo1
CPU-Threads: 4; BS: Linux 4.4; UI-Render: Standard; VCL: gtk2; 
Gebietsschema: en-GB (de_DE.UTF-8); Calc: group
Comment 15 laurens 2018-11-11 16:23:41 UTC
I am also getting these ratio problems.


For me it's a nightmare to get Graphics in frames back to the right proportions.
Comment 16 QA Administrators 2019-11-12 03:33:15 UTC Comment hidden (obsolete)
Comment 17 Gerry 2019-11-13 07:30:09 UTC
Bug still exists in LO 6.3.2

Version: (x86)
Build-ID: 98b30e735bda24bc04ab42594c85f7fd8be07b9c
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: CL
Comment 18 QA Administrators 2021-11-13 05:46:20 UTC Comment hidden (obsolete)
Comment 19 Gerry 2021-11-13 13:26:36 UTC
The bug still exists in LibreOffice 7.2.2

Version: / LibreOffice Community
Build ID: 20(Build:2)
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Ubuntu package version: 1:7.2.2-0ubuntu0.21.10.1
Calc: threaded