Bug 46253 - FILESAVE: Images inserted as reference are distorted when cropped to an image section
Summary: FILESAVE: Images inserted as reference are distorted when cropped to an image...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-18 09:38 UTC by Matthias Basler
Modified: 2013-06-23 10:41 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
The upper image should be cropped, but LibO just distorts it (101.53 KB, image/jpeg)
2012-02-18 09:38 UTC, Matthias Basler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Basler 2012-02-18 09:38:14 UTC
Created attachment 57238 [details]
The upper image should be cropped, but LibO just distorts it

Image cropping (german: Zuschneiden) does not work at all for images that are not included as image into the document, but just as reference to an image file.

To reproduce:
1. Open a new document
2. Insert a photo *as reference* into the page whose image resolution is not the screen resolution (e.g. is 300 dpi or larger). Now scale this image to a reasonable size. (This step just makes it easier to observe the result.)
3. Open the image properties dialog, go to the "Cropping"(?) tab and remove maybe 40% of the image on the left side (It depends on original image size how many cm this is.)

The preview still looks fine. Now close the dialog with "OK".
The image will now be incorrect, showing a wrong section of the photo or distorting the aspect ratio in some way.

In contrast, if you do the same on an image that has been *included* into the document, the cropping works as expected.

It might help fixing this bug if you realize that in the included image the image resolution is given as 4000dpi (which is true, it was scanned and then resized) while a referenced image of the same photo shows the resolution to be  96 dpi (=wrong). Now, in the included image you've got to remove, lets say, 0.1 cm from the left (because the image is so "small" due to the large resolution), and this works. In contrast, in the referenced image, you've got to remove 6 cm in order to get the same result in the preview, and the image size in the document is actually reduced by the same (correct) amount as for the included image, but the content of that image is not showing the correct section of the image any more. (Sometimes it shows too few, sometimes too much.)

Attached you find a screenshot illustrating this difference: The upper photo is only an image reference, and the image hasn't been cropped (only distorted) although the image property dialog shows it should be. In contrast the included image below has been correctly cropped.


Important note:
This bug has been reported by me for OpenOffice 2.x already a few years ago, but has not yet been fixed or fixed completely. Essentially this bug makes it impossible to use OOo/LibO to layout a larger book with many images/photos, because either you have to include all images (which makes OOo/LibO very slow on saving and creates huge files) or alternatively you cannot possibly use the crop function.

Reproduced with LibO 3.5.0 on WinXP SP3
Comment 1 ign_christian 2013-06-23 10:41:42 UTC
Not reproducible on LO 4.0.4.2 (Win7 32bit)

Please REOPENED if that still happen on latest stable release, also attach sample doc & image files