Bug 107703 - Improve insert behaviour of images
Summary: Improve insert behaviour of images
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 86176 (view as bug list)
Depends on:
Blocks: Writer-Images Image-DPI
  Show dependency treegraph
 
Reported: 2017-05-08 15:37 UTC by Telesto
Modified: 2019-03-01 03:49 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot (232.22 KB, image/png)
2017-05-08 17:04 UTC, Yousuf Philips (jay) (retired)
Details
Example file (239.06 KB, application/vnd.oasis.opendocument.text)
2017-05-08 17:55 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2017-05-08 15:37:54 UTC
Description:
When insert a image I noticed that the image is way to large

Steps to Reproduce:
Steps:
1) Open Writer/Draw
2) Insert an image this image http://www.exiv2.org/include/img_1771.jpg using Insert -> Image
3. 'Import' the same image by copy pasting from Firefox

Actual Results:  
Image is page filling

Expected Results:
The image should of the size similar to the Firefox copy/paste


Reproducible: Always

User Profile Reset: No

Additional Info:
Found in
Version: 5.4.0.0.alpha1+
Build ID: 274ecb49b70b3f01d47546e3b44317946c106042
CPU threads: 4; OS: Windows 6.2; UI render: default; 
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2017-05-05_22:45:07
Locale: nl-BE (nl_NL); Calc: single

and in
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4


User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Comment 1 Yousuf Philips (jay) (retired) 2017-05-08 17:04:03 UTC
Cant repo. If i copy the file in Firefox or Vivaldi, it pastes it into the document at 96 dpi and has the same number of pixels.
Comment 2 Yousuf Philips (jay) (retired) 2017-05-08 17:04:26 UTC
Created attachment 133162 [details]
screenshot
Comment 3 Telesto 2017-05-08 17:55:52 UTC
Created attachment 133163 [details]
Example file

@Jay,
I get the same results as you when copy/pasting from Firefox, but not when inserting images using Insert -> Images (or drag and drop). I get a mismatch between the actual dimension (correct) and the apparent dimension (wrong).
Comment 4 Regina Henschel 2017-05-08 19:25:58 UTC
How do you do Insert -> Images? Do you have stored the images to your hard disk; if yes, in which way? Or do you have entered the URL in the file name field in the file picker?

If I do the latter, I get an image of 16,9cm x 12,7cm at 72dpi.
Comment 5 Telesto 2017-05-08 20:30:51 UTC
@Regina Herschel
That's exactly my point ;-) When I import the image (on Windows) I get 16,9cm x 12,7cm at 72dpi (same as you). However it should be 12,70 cm x 9,53 cm at 96 dpi (like in the screenshot of Jay).

I can get the same result as Jay, if I open the image in Firefox first and then copy it into the Writer Document.
Comment 6 Regina Henschel 2017-05-08 20:47:51 UTC
You mean right-click in browser and copy to clipboard? Then I (using Seamonkey) get 120dpi; that is my screen resolution. It might be, that Firefox changes the dpi-information when putting the image to clipboard. With a "save link target" I get 72dpi.
Comment 7 Yousuf Philips (jay) (retired) 2017-05-08 21:21:35 UTC
(In reply to Telesto from comment #3)
> I get the same results as you when copy/pasting from Firefox, but not when
> inserting images using Insert -> Images (or drag and drop). I get a mismatch
> between the actual dimension (correct) and the apparent dimension (wrong).

Yes images inserted through the Insert dialog fill the page, as that is who it is supposed to be. I mistakenly thought you were saying its not coming the right way through copy/paste from the browser.
Comment 8 Telesto 2017-05-12 16:48:14 UTC
I'm still not fully convinced that the image should be imported as 16,9cm x 12,7cm
If have opened the file in multiple applications and the outcome isn't that consistent. Quite often it's resulting in: 12,70 cm x 9,53 cm
For example: Word Online or Google Docs
Comment 9 Yousuf Philips (jay) (retired) 2017-05-13 00:29:59 UTC
(In reply to Telesto from comment #8)
> I'm still not fully convinced that the image should be imported as 16,9cm x
> 12,7cm

Okay lets ask some others. @Tomaz, @Stuart, @Cor, @Hieko: Should images be imported into a document with a dpi below 96 and be stretch the width of the page, rather than keeping it at 96 dpi and having it take up less width on the page?

> If have opened the file in multiple applications and the outcome isn't that
> consistent. Quite often it's resulting in: 12,70 cm x 9,53 cm
> For example: Word Online or Google Docs

Opening the image in MS Word 2010 shows it as 6.77 cm x 5.08 cm, while WPS shows it the full width of the page at 15.92 cm x 11.94 cm.
Comment 10 Cor Nouws 2017-05-13 08:43:13 UTC
I've no preference in this situation.
I think in general inserting an image will be followed by an action to set size and position etc (by hand or style or macro), so I consider the initial situation as less interesting anyway. But that's me.
Comment 11 Tomaz Vajngerl 2017-05-13 09:55:05 UTC
At least we should be consistent... not one time use this and the other time that. If a picture has DPI set then we could use that to calculate the size, otherwise we could use some default DPI - not dependent on system DPI.
Comment 12 Regina Henschel 2017-05-13 11:57:49 UTC
LibreOffice must never change any information, that is contained in the png-image. "dpi" or to be more correct the "physical pixel dimension" chunk belongs to the png-image. If the image does not fit into a page in Writer depending on that information, the view of the image is scaled down (see crop tab in properties dialog), but the image is not changed.

If the pixel size information is missing or has no unit, then we can discuss, which ersatz LibreOffice should use. I agree with Tomaz, that it should not depend on system DPI. Perhaps 96 dpi is good, that is used for SVG-graphics in case the unit is "px".


(In reply to Yousuf Philips (jay) from comment #9)
Should images be
> imported into a document with a dpi below 96 and be stretch the width of the
> page, rather than keeping it at 96 dpi and having it take up less width on
> the page?

Always use the original dpi to calculate the size. Only scale the view, if otherwise it cannot be inserted. Do not scale up. Likely the user wants to put text besides the image.
Comment 13 Heiko Tietze 2017-05-18 06:43:32 UTC
(In reply to Yousuf Philips (jay) from comment #9)
> Okay lets ask some others. @Tomaz, @Stuart, @Cor, @Hieko: Should images be...

Fully agree with Regina.
Comment 14 Yousuf Philips (jay) (retired) 2017-05-30 19:45:59 UTC
*** Bug 86176 has been marked as a duplicate of this bug. ***
Comment 15 QA Administrators 2019-03-01 03:49:25 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug