Bug 116164 - Cropped JPEG images get distorted when changing monitor resolution
Summary: Cropped JPEG images get distorted when changing monitor resolution
Status: RESOLVED DUPLICATE of bug 115808
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Image-DPI
  Show dependency treegraph
Reported: 2018-03-03 20:40 UTC by robert_averbeck
Modified: 2018-06-24 19:23 UTC (History)
3 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 robert_averbeck 2018-03-03 20:40:50 UTC
When importing a JPEG picture Impress will try to read the resolution (dpi, ppi) from the JFIF tag. If this tag is not present Impress will use the resolution of the current monitor instead. Since the odp file format uses length units (e.g. cm) when defining image cropping, the crop values of images without JFIF tag need to be changed when changing the monitor resolution, otherwise these images get distorted. Unfortunately most digital cameras do not use the JFIF tag but the IFD0 tag. Please note that using a machine dependent default makes odp documents machine dependent. This explains user complaints about image distortion when exchanging documents between different machines.

Steps to Reproduce:
1.Import a JPEG file from a digital camera into Impress.
2.Crop the image in one dimension and save the odp file.
3.Opening this file on a machine with different monitor resolution

Actual Results:  
Image is displayed (and printed) in correct size but distorted.

Expected Results:
odp files should be machine independent.

Reproducible: Always

User Profile Reset: Yes

Additional Info:
Suggest fix: When importing a JPEG image which does not have a JFIF tag, look for an IFD0 tag. If both tags are missing, use a constant (machine independent) default value for resolution. Any fix for this bug will change the display of some existing documents. Therefore, I suggest supplying a tool that prompts the user for a dpi value and converts all odp files in a given directory.

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Comment 1 Buovjaga 2018-03-08 10:40:05 UTC

*** This bug has been marked as a duplicate of bug 115808 ***
Comment 2 robert_averbeck 2018-03-08 20:38:00 UTC
Further investigations with png images reveal that the problem is more fundamental. It applies to all images lacking a resolution value in the metadata. For these images Impress defaults to the dpi setting of the monitor, thus making odp documents machine dependent. For an uncropped image this error simply does not show because the aspect ratio stays constant (no distortion) when zooming the image to its bounding box.
Comment 3 Aron Budea 2018-03-09 01:56:39 UTC
Yes, there are a couple of similar bug reports: