Bug 158949 - Cannot crop images with a transparent background
Summary: Cannot crop images with a transparent background
Status: RESOLVED DUPLICATE of bug 107843
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-31 14:48 UTC by L Duperval
Modified: 2024-01-18 18:08 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
One page with two images where one can't be cropped (391.94 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-12-31 14:48 UTC, L Duperval
Details
Comparison of context menus (211.72 KB, application/vnd.oasis.opendocument.graphics)
2024-01-01 09:11 UTC, Rainer Bielefeld Retired
Details

Note You need to log in before you can comment on or make changes to this bug.
Description L Duperval 2023-12-31 14:48:59 UTC
Created attachment 191672 [details]
One page with two images where one can't be cropped

There are two images in the attached document. One image has a transparent background and the other doesn't. The one with the transparent background can't be cropped.
Comment 1 L Duperval 2023-12-31 16:20:19 UTC
Hmm, someone pointed out that the images that can't be cropped are not images at all but drawing objects. I didn't create the original document, so I'm not sure what the difference is between the first image and the second image. 

So I actually don't know if this is a bug or not. I won't touch the status and I'll let someone else determine whether it should be discarded or not.
Comment 2 m_a_riosv 2024-01-01 03:04:47 UTC
You can see with the navigator [F5] or looking for it in the sidebar, there are one image and two drawing objects.
I don't know how those photographs ends as draw objects.

Two options to make available crop:
Cut + Paste special as GDI
Cut + Paste in a new Draw file.
Comment 3 Rainer Bielefeld Retired 2024-01-01 09:11:14 UTC
Created attachment 191681 [details]
Comparison of context menus

Effect is REPRODUCIBLE with Server Installation of Version: 24.2.0.0.alpha0+ (X86_64)
Build ID: 7fff4e2ca6739928f72e5f0d2eb5820823916769
CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: Locale: de-DE (de_DE); UI: de-DE; Theme: Colibre
Calc: CL threaded – normal Test Profile created from 7.6

But as m.a.riosv already told: Those "images with transparent background" are not simple images, but Drawing objects. Alternateve approach for examination: Do rightclick on the picture elements. Context menus for Drawing Elements are completely different from Context Menus to Pictures like .png. See Attachment with comparison.

Currently I can not see a LibO Bug.
Comment 4 Telesto 2024-01-01 09:42:17 UTC
(In reply to m.a.riosv from comment #2)
> I don't know how those photographs ends as draw objects.

See bug 107843. Cross paste from Draw/Impress to writer. The lack of crop is handled mentioned bug 107843 comment 3

This is a duplicate of bug 107843, IMHO
Comment 5 m_a_riosv 2024-01-01 20:57:22 UTC
But in any case, if the reporter could confirm how these objects arrived at writer, it could help to know if it is indeed the duplicate commented.
Comment 6 L Duperval 2024-01-02 02:09:56 UTC
HI,

I can't confirm how they were created. However, this discussion might shed some light:

https://ask.libreoffice.org/t/writer-unable-to-crop-an-image/100047/7

In particular this comment:

I had a quick look using Word and Writer. It seems if Soft Edges is applied in Word then it creates some sort of wrapper for the picture. Writer can recognise that it has soft edges and applies them, although with 5pt not the original 8.84pt. What Writer seems unable to do is to unwrap and extract the image.

If I set Soft Edges to No soft edges (not 0pt radius which leaves the wrapper) in Word, then Writer can crop, and the image is just a normal jpg.
Uncroppable image100047 - Word-NoSoft.docx (398.1 KB)

It looks like an incomplete interpretation in the import filter. Can you please report a bug
Comment 7 Buovjaga 2024-01-18 18:08:17 UTC

*** This bug has been marked as a duplicate of bug 107843 ***