Bug 159714 - Pasting an image over an existing image in Writer may change its aspect ratio
Summary: Pasting an image over an existing image in Writer may change its aspect ratio
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-14 07:30 UTC by lvm
Modified: 2024-02-15 08:41 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot 1 (7.30 KB, image/png)
2024-02-14 07:30 UTC, lvm
Details
screenshot 2 (3.74 KB, image/png)
2024-02-14 07:31 UTC, lvm
Details
screenshot 3 (8.40 KB, image/png)
2024-02-14 07:31 UTC, lvm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lvm 2024-02-14 07:30:59 UTC
Created attachment 192553 [details]
screenshot 1

When picture is pasted into a write document in place of existing picture its aspect ratio changes to fit that of the original picture. While such behaviour may be sometimes desirable, in general distorting a picture is not a good idea. I'd like to be able to retain the aspect ratio of the pasted picture while keeping other formatting options of the selected picture at least as an option, probably as the default behaviour.

Consider the following scenario: 
1. create two objects in LibreOffice Draw - oblong rectangle and a circle (screenshot 1)
2. copy the rectangle to the clipboard and paste into Write
3. copy the circle to the clipboard
4. click on the rectangle in Write to select it (screenshot 2)
5. paste the circle - an ellipse is pasted instead of a circle (screenshot 3)
Comment 1 lvm 2024-02-14 07:31:17 UTC
Created attachment 192554 [details]
screenshot 2
Comment 2 lvm 2024-02-14 07:31:33 UTC
Created attachment 192555 [details]
screenshot 3
Comment 3 Rafael Lima 2024-02-14 13:25:48 UTC
I, too, dislike this behavior. The current behavior will be wrong 99% of the time.

The problem seems to be that when you paste the new image, the width and height properties are not updated.

So to fix the issue you're forced to right-click the image, then go to Properties and click Original Size.

TBH this feels like a bug to me.
Comment 4 Rafael Lima 2024-02-14 13:36:28 UTC
FTR this issue arises when pasting any images over existing images in Writer (not only images from LO Draw as reported by the OP).

Steps to reproduce
1) Create a blank Writer document
2) Copy and paste any image (from the browser or from the screenshot tool, or anywhere really)
3) Paste the image on the new Writer document
4) Now copy any other image with a different size
5) Select the previously pasted image in Writer
6) Press Ctrl+V to paste the new image and replace the old image
7) The size of the previous image is maintained

I'm changing the title for clarity.
Comment 5 Rafael Lima 2024-02-14 13:43:23 UTC
This problem does not exist in Impress. Pasting an image on top of another image to replace it will update the image size as expected.
Comment 6 Telesto 2024-02-14 20:34:01 UTC
Also in
Versie: 4.4.7.2 
Build ID: f3153a8b245191196a4b6b9abd1d0da16eead600
Locale: nl_NL

and in
LibreOffice 3.5.7.2 
Build ID: 3215f89-f603614-ab984f2-7348103-1225a5b

The current behaviour is more or less a shortcut for right click context menu -> replace function. To CTRL+V acts as 'replace' image (so not changing dimensions).

Requested here: overwrite the current one for the new one. I have tendency to prefer overwrite above, replace as normal expectation. 

Argument for doing nothing: CTRL+V being used to replace images.. breaking current workflows.
Comment 7 lvm 2024-02-15 05:58:12 UTC
(In reply to Telesto from comment #6)
> Requested here: overwrite the current one for the new one. I have tendency
> to prefer overwrite above, replace as normal expectation. 
To make myself clear, I am not requesting to change dimensions to that of the new image. I propose to scale the new image to fit the same space but retain its aspect ratio while doing so. Of course it may create some unallocated space which will require one of the dimensions to be shrunk, but no more than necessary.
Comment 8 Heiko Tietze 2024-02-15 08:41:08 UTC
It's not a bug but a feature, well not entirely. If you paste the image onto a shape it will be used to fill the object- quite a handy feature. Apparently it happens in case of images as well, yet the (totally pointless) area fill attribute does not show the applied "filling". IMO we have to block this, hide the area fill for images, and make the paste-to-fill feature working in Draw/Impress (again). We likely have tickets on all of these issues.