Bug 157395 - Does it "Preferred resolution for images" work?
Summary: Does it "Preferred resolution for images" work?
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.1.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Images
  Show dependency treegraph
 
Reported: 2023-09-23 12:39 UTC by Gabriele Ponzo
Modified: 2023-09-26 17:59 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Preferred-resolution-for-images_test-file (5.66 MB, application/vnd.oasis.opendocument.text)
2023-09-23 12:39 UTC, Gabriele Ponzo
Details
Properties-Crop_detail (62.59 KB, image/png)
2023-09-23 21:06 UTC, Gabriele Ponzo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriele Ponzo 2023-09-23 12:39:51 UTC
Created attachment 189770 [details]
Preferred-resolution-for-images_test-file

I've noticed this new (at least for me :) feature but when I tested it doesn't seem to work at all. It could possibly be me misunderstanding how to use it anyway.

1. Open LibreOffice Writer;
2. Open File -> Properties and then go to "General" tab;
3. Flag the "Preferred resolution for images:" check box;
4. Specify (let's say) 300dpi and then press "OK" on the bottom right;
5. Insert a big image (possibly from a camera) with more than 3000px on its horizontal side;
6. Save the document somewhere and start comparing its file size with the picture file;
7. Close LO and open the document again;
8. Right click on the picture and select "Compress...".

Expected behavior:
I'd expect to see the horizontal size to have scaled around 2000px and the size accordingly but

Actual behavior:
The image is exactly as I left it (in my case 6016x4016px, 5756kB).
Comment 1 m_a_riosv 2023-09-23 14:06:27 UTC
Right-click on the image, select Properties – [Crop], the resolution it's 300 PPI.
Comment 2 Gabriele Ponzo 2023-09-23 21:06:17 UTC
Created attachment 189781 [details]
Properties-Crop_detail
Comment 3 Gabriele Ponzo 2023-09-23 21:06:54 UTC
(In reply to m.a.riosv from comment #1)
> Right-click on the image, select Properties – [Crop], the resolution it's
> 300 PPI.

Sure: if the paper was ~51cm wide :)
Comment 4 Franklin Weng 2023-09-24 05:05:38 UTC
Confirmed in 

Version: 7.6.0.3 (X86_64) / LibreOffice Community
Build ID: 69edd8b8ebc41d00b4de3915dc82f8f0fc3b6265
CPU threads: 4; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: zh-TW (zh_TW.UTF-8); UI: zh-TW
Calc: threaded

I'm feeling that it is confusing to users.  What user (alright, me) expects is have a good resolution (as good as 300 DPI) **in this dimension 481.9x321.7 pt**.  But the behavior seems to be that, when setting the Preferred Resolution For Images to 300 PPI it told me "yes, this image is 300DPI when it is 1443.8x963.8 pt" (which means, no, it is not since the images is only 481.9x321.7 pt).

I'm not sure if it is a UX problem.  And honestly I have no idea what this "Preferred Resolution For Images" property is actually doing.  And honestly, the help

Preferred resolution for images

Check this box to select the preferred image resolution in points per inch, which is used as default when an image is inserted into a Writer, Impress or a Draw document and resize it according to the value in the list box.

doesn't help much to let users understand what it is really doing.
Comment 5 Heiko Tietze 2023-09-26 10:36:21 UTC
The option was introduced by Tomaz per https://gerrit.libreoffice.org/c/core/+/126334 (no BZ reference). To become effective the image needs compression - and I don't see the suggestion to be applied there.
Comment 6 Tomaz Vajngerl 2023-09-26 17:59:17 UTC
This is not about automatic recompression of bitmap images with too high DPI - it is somewhat related however and could be used for things like this. 

Setting the preferred DPI does not automatically do anything (yet). If the preferred DPI setting is set it will only enable the "Graphic Size Check..." dialog, where it will go through all the images in the document and warn if the image is too far off from the preferred DPI - yes too low and too high.
 
The issue is that re-compressing the images is not the only way how to lower the DPI of an image in the document - you can just make it bigger in the document to do the same also. 

A reverse thing can also be done when the DPI is too low - you can make the image smaller (well this is the only thing you can do outside of creating a new one).