Bug 154300 - Pasting an image from Draw pastes it as Drawing object
Summary: Pasting an image from Draw pastes it as Drawing object
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 157959 (view as bug list)
Depends on:
Blocks: Writer-Images
  Show dependency treegraph
 
Reported: 2023-03-21 07:16 UTC by Mike Kaganski
Modified: 2023-10-30 19:34 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
copy image from draw and a writer sessions paste special on recent master (260.55 KB, image/png)
2023-03-21 13:50 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2023-03-21 07:16:06 UTC
1. Create a Draw document
2. Insert an image (e.g., a PNG) into it (Insert->Image)
3. Copy the inserted image to clipboard
4. Create a new Writer document
5. Paste from clipboard into the newly created Writer document
6. Open Navigator, and check in which category the inserted object appeared
7. In the same Writer document, use Insert->Image, and compare in which category the image appears when inserted directly.

The object from step 5 appears in Navigator under Drawing objects category.
The object from step 7 appears in Navigator under Images category.

The problem here is that Drawing objects can't have a Frame style assigned. So the images that needed some pre-processing in Draw (say, where Writer has no needed functionality, like blurred shadow) would not have frame style, making it more difficult to manage (say, assign a uniform anchoring/positioning), requiring to be put inside an outer frame to achieve the goal (see https://ask.libreoffice.org/t/how-to-keep-image-anchor-in-place/89384).

It would be nice if the objects coming from modules get the "simplest" (most "native") type when inserted into other modules.
Comment 1 V Stuart Foote 2023-03-21 13:50:25 UTC
Created attachment 186117 [details]
copy image from draw and a writer sessions paste special on recent master

@Mike, any of the multiple raster formats in addition to the default drawing format is available with Paste Special. Why would we change the clipboard default just for images when other drawing shapes/text boxes would be the preferred default for paste?
Comment 2 Mike Kaganski 2023-03-21 14:03:03 UTC
(In reply to V Stuart Foote from comment #1)
> any of the multiple raster formats in addition to the default drawing
> format is available with Paste Special.

Please read the description. It is not about the choice of the *raster format*. Trying to paste as a BMP would make a *conversion*, and e.g. disallow you to subsequently control the properties (e.g., increase or remove the shadow, which is mentioned as a rationale). The question is, which *native* sub-format should we use when copying the image from Draw: I think that it should be Image (as Writer does, when copying images from it).
Comment 3 Robert Großkopf 2023-03-22 10:40:37 UTC
Could confirm the buggy behavior.
Images, which were pasted from Draw to Writer where set as drawing Objects. In this part it is impossible to set "image" to original size, to cut "image" …
Comment 4 Regina Henschel 2023-10-29 08:27:31 UTC
As long as Draw-images and Writer-images have different feature sets in Writer it is no good idea to insert an image from Draw as Writer-image. Pasting as Draw-images is currently the only way to get blur shadow for the image, for example.
Comment 5 Mike Kaganski 2023-10-29 08:39:45 UTC
*** Bug 157959 has been marked as a duplicate of this bug. ***
Comment 6 Tomislav Nakic-Alfirevic 2023-10-29 08:44:44 UTC
It is also impossible to export/save pasted images from an .odt document, requiring users to reach for clumsy workarounds like renaming the .odt to a .zip and copying the pasted image from a subdir in the zip.