Bug 138765 - set the displayed size of an image inserted in Writer by changing its DPI
Summary: set the displayed size of an image inserted in Writer by changing its DPI
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.3.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Images Image-DPI
  Show dependency treegraph
 
Reported: 2020-12-09 08:07 UTC by skierpage
Modified: 2020-12-16 08:21 UTC (History)
2 users (show)

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


Attachments
mockup of Image properties > Crop adding Resolution (DPI) and keep aspect ratio (101.89 KB, image/png)
2020-12-15 02:56 UTC, skierpage
Details

Note You need to log in before you can comment on or make changes to this bug.
Description skierpage 2020-12-09 08:07:57 UTC
When I create images for Writer, I usually create the image with a size in pixels ("canvas size") to have the physical size I want when printed at a certain DPI optimized for my target printer's resolution.

Unfortunately when I insert the image into LO Writer, it doesn't let me control the physical image size by setting DPI. Sometimes it picks up the PPI from the image (but not always, sometimes it defaults to the display screen's resolution of 96 or 120 PPI, see bug 52598); but if I want to specify a DPI, I can't. I have to calculate a physical size from the image size in pixels and my desired DPI and enter that.

@Alex Kemp made this suggestion in https://ask.libreoffice.org/en/question/51938/inserting-image-in-writer-without-scaling/ :
"Writer should have the option to calculate the size of the image in cm, just by setting the desired DPI setting, and without recalculating the image"

The fix is to add a Dots per (Length) control to the Scale/Image Size section of the Image > Crop dialog, so you have three ways to scale an image: percentage scale, image size in physical units, and Dots per (length unit, default Inch in USA).

As you change the other settings, the Dots per (Length) should update to show the resulting DPI of your chosen scale/image size -- all three settings should update as you change the others. This means the dialog need separate numbers for width and height, even though with current printers you rarely design images for different horizontal and vertical resolutions. At that point it should probably get a toggle to lock horizontal and vertical to preserve aspect ratio.
Comment 1 Telesto 2020-12-09 16:29:06 UTC
Adding UX, but I assume this handled already somewhere (at least the UI topic). See (meta) bug 116082 for list of this kind of issues..

The image size based on screen resolution surely painfully annoying (with images lacking embedded DPI setting)
Comment 2 Heiko Tietze 2020-12-14 14:50:36 UTC
There are many duplicates. To measure the importance of an issue we consider the number of duplicates and people on CC. So having one ticket that rules all issues is better than many.

Bug 34133 - Add option (+settings?) to compress and resize images: automatically either on insertion of an image or on save, and via a separate menu entry for all images
Bug 132656 - Show proper actual dimensions in Compress Image dialog
Bug 132658 - ENHANCEMENT: Image without resolution set should get a default fallback resolution (not based on a screen resolution)
and the mentioned
Bug 52598 - Writer ignores original picture pixel density in .jpg files, and uses 120 dpi (refer comment 19)

Making it a duplicate of Bug 115464 - UI of export to PNG and JPG misleading for resolution since this one has a mockup (but focus on export). If this is totally wrong please check the META bug - or reopen.

*** This bug has been marked as a duplicate of bug 115464 ***
Comment 3 skierpage 2020-12-15 02:56:54 UTC
Created attachment 168178 [details]
mockup of Image properties > Crop adding Resolution (DPI) and keep aspect ratio

See also similar mockups for image _file_ size attached to bug 115464. The settings are different.
Comment 4 skierpage 2020-12-15 03:05:38 UTC
(In reply to Heiko Tietze from comment #2)
First, thanks so much for responding! ❤ 

> Bug 34133 - Add option (+settings?) to compress and resize images:
> automatically either on insertion of an image or on save, and via a separate
> menu entry for all images
No, I don't want to compress my image, it's perfect: I just, as my description says, want to set the displayed size of the image by DPI. (The ambiguity of visual size vs. file size is confusing.)

> Bug 132656 - Show proper actual dimensions in Compress Image dialog
I don't want to compress.

> Bug 132658 - ENHANCEMENT: Image without resolution set should get a default
> fallback resolution (not based on a screen resolution)
Close, but I want to _control_ the DPI in Writer. After understanding this problem with Writer I started setting the resolution of my images in GIMP, and Writer uses it (hooray!), but my request here is regardless of the resolution in the image file I want to set the displayed size of the image in Writer by DPI.
 
> Making it a duplicate of Bug 115464 - UI of export to PNG and JPG misleading
> for resolution since this one has a mockup (but focus on export). ...
The UI for Image > Crop > Scale would be similar to attachment 142611 [details] , but instead of _file sizing_ by dimension, resolution, or pixels, the controls are _scaling displayed size_ by percentage, image dimensions, or resolution in DPI/Dots per Length. I made my own mockup, attached (disclaimer, I have no idea how display size interacts with Crop).

> ... If this is
> totally wrong please check the META bug - or reopen.

Respectfully, I'm reopening as a separate bug. I added this bug as a dependency of Writer-Images and Images-DPI, and commented in bug 115464 that Writer's image properties > Crop > Scale needs a similar three-way control.

Looking at some of the bug reports, people seem unhappy with Writer's guess as to how big to make an inserted image, so maybe this UI to scale/size by percentage, dimensions, or DPI should be to be part of the Insert > Image dialog, or an immediate second step, instead of making people find Format > Image > Properties or right-click Properties > Crop.


Thanks for all your efforts, everyone.
Comment 5 Heiko Tietze 2020-12-15 07:07:13 UTC
(In reply to skierpage from comment #3)
> Created attachment 168178 [details]
Thanks for the proposal. Basically it does what you ask for (not sure if different dpi for the dimensions is possible). Rather than adding the new option to the right we should go with something like

(o) Scale      Width: [   ] Height: [   ]
( ) Image Size Width: [   ] Height: [   ]
( ) Resolution Width: [   ] Height: [   ] [dpi v]


Don't think it's beneficial to have many tickets for every detail in case of enhancements. 
And I expect confusion if we realize the scale/size/resolution/compression request differently for internal data and export.