Bug 158729 - Cropped images change on compression
Summary: Cropped images change on compression
Status: RESOLVED DUPLICATE of bug 83734
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.3.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-16 09:15 UTC by carlopav
Modified: 2023-12-21 15:13 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Requested screenshot (62.40 KB, image/jpeg)
2023-12-18 09:39 UTC, carlopav
Details
Steps and screenshot (deleted)
2023-12-18 10:48 UTC, carlopav
Details
Sample file with two copies of image cropped and compress without lost size (66.24 KB, application/vnd.oasis.opendocument.text)
2023-12-19 16:36 UTC, m_a_riosv
Details
Screenshot (434.95 KB, image/png)
2023-12-20 02:49 UTC, Telesto
Details
Example file (731.63 KB, application/vnd.oasis.opendocument.text)
2023-12-20 02:52 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description carlopav 2023-12-16 09:15:20 UTC
Description:
When compressing a cropped image with jpeg option, the image deforms.

Steps to Reproduce:
1. insert an image
2. crop the image
3. compress the image with jpeg option

Actual Results:
the image keeps the frame size, but appears to be scaled in non uniform way

Expected Results:
the compression should not change the image visualization.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 12; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: it-IT (it_IT); UI: it-IT
Calc: CL threaded
Comment 1 m_a_riosv 2023-12-16 16:26:15 UTC
Please attach a screenshot of compress options box.
Comment 2 carlopav 2023-12-18 09:39:07 UTC
Created attachment 191478 [details]
Requested screenshot

Hello, here is the screenshot.
Many thanks
Comment 3 carlopav 2023-12-18 09:39:26 UTC
Here is the screenshot,
many thanks
Comment 4 carlopav 2023-12-18 10:48:10 UTC
Created attachment 191482 [details]
Steps and screenshot
Comment 5 carlopav 2023-12-18 10:49:36 UTC
Sorry I messed up with screenshot attachment....
Can you delete last one?
thanks :)
Comment 6 m_a_riosv 2023-12-18 16:26:11 UTC
(In reply to carlopav from comment #5)
> Sorry I messed up with screenshot attachment....
> Can you delete last one?
> thanks :)
I'll ask, but it is very unusual.
Comment 7 m_a_riosv 2023-12-18 16:26:35 UTC
Have you tested with resolution options disable?
Comment 8 Xisco Faulí 2023-12-18 16:45:46 UTC
The content of attachment 191482 [details] has been deleted for the following reason:

User's request
Comment 9 carlopav 2023-12-18 18:30:03 UTC
(In reply to m.a.riosv from comment #7)
> Have you tested with resolution options disable?

Yes, it does not change the result. Can you reproduce the bug?
Comment 10 QA Administrators 2023-12-19 03:11:36 UTC Comment hidden (obsolete)
Comment 11 carlopav 2023-12-19 07:30:35 UTC
I mean, if I do not mark the resolution checkbox the bug is still present.
Comment 12 carlopav 2023-12-19 07:32:21 UTC
This is a quite critical bug to me because it makes cropping images unusable.
Comment 13 m_a_riosv 2023-12-19 16:36:23 UTC
Created attachment 191506 [details]
Sample file with two copies of image cropped and compress without lost size

Import the image.

Select it with the navigator, right-click on the image name, select edit.
On Position-Size tab:
- Deselect Size 'Relative to'
- Select 'Keep ratio'
. Click on original size.
Now crop and compress.
Seems to work for me. Surely, there is an easy way to get it.

Not sure if it is a bug or how the options for the image are.
Comment 14 m_a_riosv 2023-12-19 16:42:08 UTC
(In reply to carlopav from comment #12)
> This is a quite critical bug to me because it makes cropping images unusable.
In any case, this is an Open Source project.
Some developer should take care of it, but they are free to solve the bug they want.

Maybe you can find/ask for a solution in ask.libreoffice.org
There are several languages, but perhaps the best to try is the English.
Comment 15 Telesto 2023-12-20 02:49:56 UTC
Created attachment 191525 [details]
Screenshot

Top image untoched.
Second image compress PNG with reduce image resolution change checked, blurry
Third image compressed JPG, with reduce image resolution change checked. Crop lost and skewed
Comment 16 Telesto 2023-12-20 02:52:18 UTC
Created attachment 191526 [details]
Example file

Crop might differ from screenshot, as crop might be based on screen resolution. This was the case, unsure if it still a topic
Comment 17 Telesto 2023-12-20 15:24:44 UTC
Appears to be a longstanding bug

*** This bug has been marked as a duplicate of bug 83734 ***
Comment 18 carlopav 2023-12-20 15:32:24 UTC
Thanks for the tip! Hope someone can work on it. Do you know if there some way to create a bounty or something like?
Comment 19 Telesto 2023-12-20 15:59:43 UTC
(In reply to carlopav from comment #18)
> Thanks for the tip! Hope someone can work on it. Do you know if there some
> way to create a bounty or something like?

The bounty system has been tried in the past, unsuccessfully. The bounty is probably way to small to make any difference at all. It would need to up to 20.000-25.000 US-dollar for some interest. A very high bar.

The bug will hit the 10 year anniversary next year I fear :-(. Straight forward bug getting fixed at snail's pace. t's a bit of a shame, I know. (LibreOffice) developers are a scarce commodity.
Comment 20 carlopav 2023-12-21 10:26:21 UTC
(In reply to Telesto from comment #19)
> The bug will hit the 10 year anniversary next year I fear :-(. Straight
> forward bug getting fixed at snail's pace. t's a bit of a shame, I know.
> (LibreOffice) developers are a scarce commodity.

That's a pity. I do not have any experience with Libreoffice source code, but it seems to me that it could just be a matter of the parameters passed to the compress algo or library... could you help me to locate the part of the source?
Comment 21 Telesto 2023-12-21 15:13:01 UTC
(In reply to carlopav from comment #20)
> That's a pity. I do not have any experience with Libreoffice source code,
> but it seems to me that it could just be a matter of the parameters passed
> to the compress algo or library... could you help me to locate the part of
> the source?

A LibO developer did peek into it (not his expertise though). See bug 83734 comment 25 (26 and 27). There are some fundamental design flaws involved, I fear (not a developer). Crop is for example depending on screen dpi. Crop something on hiDPI screen and open it with low dpi screen. See list of bugs in this area:
https://bugs.documentfoundation.org/show_bug.cgi?id=116082

The code needs a fundamental overhaul (refactor). Or at least that's my estimate. A quick fix is probably impossible. And likely a hell of a job, if you're unfamiliar with the code. 

I can add some who can give you more guidance on code pointers and such if you like digging into it anyhow or to give it a try.. developers are surely needed :-)