Bug 77407 - Option to automatically reduce unnecessarily high image resolution at insert time
Summary: Option to automatically reduce unnecessarily high image resolution at insert ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected) Master
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
Depends on:
Blocks: Image-Compression
  Show dependency treegraph
Reported: 2014-04-13 19:09 UTC by Jérôme Bouat
Modified: 2022-11-12 15:28 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description Jérôme Bouat 2014-04-13 19:09:05 UTC
Beside the feature described in bug #34133, I would like a complementary feature.

I think that the resolution (DPI) should be kept below a maximum limit at insertion time. Basically you can reasonably assume that the image would possibly not exceed the page dimension. This would keep enough margin in order to later crop or resize the image before exporting with the "minimizer" tool.

At my office, the users are creating a lot of LO Writer documents and they won't use a simple click in order to reduce the size of the document. With a standard page, what should we keep 10 Megapixel images for ?

For example, if you have a 10 Megapixel image (4/3 form factor, 3640 pixels for the big side), it will exceed 300 dpi if you make this image fill a A4 page (21x29,7 cm or 8,3x11,7 inches or 2480x3507 pixels at 300 dpi). Note that the A4 form factor doesn't fit a 4/3 form factor of the image. The difference between those form factors and the maximum number of pixel allowed by the page (user defined maximum resolution) would help to guess the new resolution of the inserted image.

Moreover, if you take into account a 1 cm margin, the area to be fit is 2362x3390 pixels at 300 dpi. This would increases the gap between the resolution of the inserted image and the user defined max dpi.

Maybe this feature could have an option in order to tell if the margins of the page should be taken into account (in addition to the user defined max dpi).

If a user need a part of an image to fit the full page, then he/she would use a specific image processing tool or he/she would disable this feature into the settings dialog.
Comment 1 Robinson Tryon (qubit) 2014-12-21 23:13:27 UTC
Once again, wishing you a Merry UXmas, team!

Status -> NEW
Comment 2 Robinson Tryon (qubit) 2016-08-25 05:26:51 UTC Comment hidden (obsolete)
Comment 3 Heiko Tietze 2017-05-02 14:21:38 UTC
Closing this ticket and comment on 34133.

*** This bug has been marked as a duplicate of bug 34133 ***
Comment 4 Luke 2017-05-02 17:36:59 UTC
I'm fine with this being an optional feature. But destructive defaults that are on by default is a terrible idea. Let's keep this issue separate until we've had more time to discuss this.
Comment 5 Heiko Tietze 2017-05-02 19:26:36 UTC
(In reply to Luke from comment #4)
> I'm fine with this being an optional feature. But destructive defaults that
> are on by default is a terrible idea. Let's keep this issue separate until
> we've had more time to discuss this.

What qualifies this ticket to be opened again? Is there an advantage of having two duplicate tickets open?
Comment 6 Luke 2017-05-02 20:12:04 UTC
This bug is asking for a destructive action AT INSERT TIME. However, bug 34133 asks for THE OPTION. Every other Office Suite handles this as an export, publishing time, because the operation is destructive. 

A destructive operation cannot be undone. Therefore, it's not **optional**. Even if bug 34133 is “resolved” with this poorly thought out at insert time idea. I would file a new bug report asking for the option to do it at export time, because this feature is not useful for most use cases at insert time. 

For example, if I have need to shrink a document to < 5MB to email, I would do the at the end of my work flow. With insert time options, this would not be possible. So bug 34133 wouldn't actually be resolved. 

These are 2 totally separate issues.
Comment 7 Tomaz Vajngerl 2017-05-02 21:10:57 UTC
(In reply to Luke from comment #6)
> Every other Office Suite handles this as an export, 
> publishing time, because the operation is destructive. 

MS Office doesn't - it automatically compresses on save.

See here description how to turn it OFF (because it is ON by default): https://support.office.com/en-us/article/Turn-off-picture-compression-81a6b603-0266-4451-b08e-fc1bf58da658
Comment 8 Heiko Tietze 2017-11-27 12:38:52 UTC
We talked about this topic in the design meeting Apr/27 2017 and agreed on the idea. Removing needsUX.

Comment 9 Jérôme 2020-02-21 20:12:09 UTC
In reply to comment #7 and #8.

Maybe the settings dialog could provide a choice between :
- no compression
- compression at insert time
- compression on save

About the resolution, I imagine 2 different parameters :
A. the resolution limit which prevents the compression if the image resolution is below this limit
B. the new resolution applied when it compresses the image

As a default parameter we could apply this ratio :
A = 2.0 * B

This would avoid the compression of an image which already has a resolution between A and B and thus avoid a size increase (although the quality decreases in most cases).

Of course, the compression would maintain the kind of the original image (lossy or lossless compression).

For lossless compression : a check box could provide a "use indexed colours" option (with parameter 256 by default ?).
Comment 10 Jérôme 2020-03-08 15:35:22 UTC
As proposed by bug #117082, the "compression on save" choice could provide a checkbox like "discard areas outside cropped areas".
Comment 11 Luke 2020-03-08 16:38:46 UTC
> "discard areas outside cropped areas"

or more simply "Delete cropped area of pictures". This should only be triggered manually, as a Save or Publish option at the end. You don't want to discard this data until the user requests it.
Comment 12 Jérôme 2020-03-09 17:26:11 UTC
The "delete cropped area of picture" option could be disabled by default. Moreover, this option would be ignored if the choice is different from "compression on save".
Comment 13 Telesto 2021-11-17 20:10:29 UTC
*** Bug 132652 has been marked as a duplicate of this bug. ***
Comment 14 Stéphane Guillou (stragu) 2022-11-12 15:28:37 UTC
Renamed summary to be more specific. Am I right to keep the word "option" in there, so the user can turn it off?

Design meeting minutes Heiko mentioned in Comment 8 are now here: https://wiki.documentfoundation.org/Design/Meetings/2017-04-27

Here is the relevant part from the minutes:

  * Auto compression of images
    + https://bugs.documentfoundation.org/show_bug.cgi?id=77407
    + https://bugs.documentfoundation.org/show_bug.cgi?id=34133
    + Proposed solution is a dropdown to reduce DPI / compress image on
      + Requires some settings under Tools > Load/Save
    + Having options for each and every function is suboptimal
    + Alternatively select all (ctrl+A) and compress (all) images could
be useful
    + Close 77407 as DUP of 34133
    + When
      + a) on insert, b) manually
      + have a checkbox in the insert image dialog to disable the
      + insert with a fix dpi as defined in tools > options
      + select all and use the known dialog should work too
    + Where
      + tools > options
    + What
      + apply compression to only jpg?
      + no, every image above the defined dpi level
    + What option needs to be provided
      + auto compression on/off
      + dpi with steps from 50 to 600
      + bmp and tiff should be converted & compressed as png or jpg based
on their size (jay)
    + Default values
      + on by default
      + 300 dpi
        + jpg compression defaults - gimp 90%, pinta 85%, krita 80%, LO
compression dialog 90%
        + png compression defaults - gimp 9, krita 9, LO compression
dialog 9
    + Competitors:
      + Word:
         + in options dialog - http://imgur.com/yD4SJaN