Bug 84800 - VIEW: Cropping image interferers with scaling of the the windows environment
Summary: VIEW: Cropping image interferers with scaling of the the windows environment
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.1.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 157407 (view as bug list)
Depends on:
Blocks: Image-Crop Image-DPI
  Show dependency treegraph
 
Reported: 2014-10-08 12:01 UTC by amon
Modified: 2023-12-15 19:05 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
The picture in the upper left corner is scaled and cut back different (35.66 KB, application/vnd.oasis.opendocument.text)
2014-10-08 12:01 UTC, amon
Details
.odt file with a picture cut back in the upper left corner (32.53 KB, patch)
2014-10-09 06:21 UTC, amon
Details
screenshot with windows 100% scaling (130.47 KB, image/png)
2014-10-09 08:35 UTC, amon
Details
screenshot with windows 125% scaling (167.96 KB, image/png)
2014-10-09 08:35 UTC, amon
Details
A test doc in Flat ODT (63.49 KB, application/vnd.oasis.opendocument.text)
2021-05-23 15:23 UTC, V Stuart Foote
Details
odt with image crop scaling issue (26.68 KB, application/vnd.oasis.opendocument.text)
2023-09-26 07:51 UTC, Mihai Vasiliu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description amon 2014-10-08 12:01:43 UTC
Created attachment 107554 [details]
The picture in the upper left corner is scaled and cut back different

A writer document created in a Windows graphic environment scaled to 100% looks different on a system scaled to 125% or 150%. This is evil because it`s hard to find the failure and many people won`t recognize they have a wrong looking version of a document. I recognized the issue because I had pictures in a document scaled and cut back different when using on OS with different scaling.
Comment 1 Joel Madero 2014-10-08 16:52:59 UTC
The document you provided has empty slots for images - I suspect they are linked to file instead of embedded.

Also please provide clear, enumerated steps to reproduce. 

Lastly please try to refrain from the extra language like "this is evil..." - doesn't add anything to the bug report and does not help to encourage our volunteers to give their time for free.

Marking as NEEDINFO as the description is not clear and the sample document doesn't load correctly. Mark as UNCONFIRMED after correcting these. Thanks
Comment 2 amon 2014-10-09 06:21:26 UTC
Created attachment 107588 [details]
.odt file with a picture cut back in the upper left corner

A. Make sure your windows 7 graphic environment is scaled to 100% following the steps below:

1. In Control Panel, click Appearance And Personalization.
2. Under the Display heading, click Make Text And Other Items Larger Or Smaller.
3. The default scaling options allow you to choose a 100-percent scale (the default), a 125-percent scale, or a 150-percent scale. To use one of these scaling options, make a selection, and then click Apply.
4. To choose a custom setting of between 100 and 500 percent, click Set Custom Text Size (DPI) in the left pane, and then use the Scale combo box to select or specify a scale.
5. You need to log off the user and then log on the user again for the changes to take effect. desktop

B. Open the attached file and have a look at the logo in the upper left corner. Close the file.

C. Now set your windows graphic env. scaling to 125% by following the steps as described before.
D. Open up the attached file again. The Logo should disappear since the picture is cut back and scaled different. Therefore only a white picture can be seen instead of the logo.
Comment 3 amon 2014-10-09 06:25:13 UTC
sorry for the sloppy speech and the unclear description. I hope it is to satisfaction now. Thanks for your guidance
Comment 4 Cor Nouws 2014-10-09 07:57:22 UTC
Hi amon,

Thanks for the additional description.
Nearly clear to me ;)

So the problem is that when you view the document with scaling in the  Windows graphic environment, that the picture is ... not shown? white? wrong size ?

Maybe you can also make a screen shot for 100% and one with the different scaling?
(Sorry, I've  no windows to test in)

thanks,
Cor
Comment 5 amon 2014-10-09 08:35:02 UTC
Created attachment 107598 [details]
screenshot with windows 100% scaling
Comment 6 amon 2014-10-09 08:35:30 UTC
Created attachment 107599 [details]
screenshot with windows 125% scaling
Comment 7 amon 2014-10-09 08:41:34 UTC
Hi Cor,

the attached screenshots should make it clear. It is to be seen that the Picture which has has a lot of whitespace around the logo is cut back to fit the logo into the document. When scaled to 100% the cut back values are different and also the scaling is different. As a result of this, the logo is no longer to be seen in the document, but only the white space of the picture. 

In Other words: If the background of my picture would be black instead of white, you would see only black area instead of the logo.

Im sorry the picture is choosen a bit unlucky becaus of the white background.

Best,

Amon
Comment 8 Cor Nouws 2014-10-09 15:28:34 UTC
thanks Amon,

I think that the cropping is related to the problem here ;)
So to circumvent you could use a picture that doesn't need cropping.

Still, it's a bug and thanks for clarifying.

Did you see the problem in previous versions too (I expect it to be an old problem...)

I set the severity to normal. (others in QA could point you to the page where that is explained, Sorry I don't know that.)

Cor
Comment 9 amon 2014-10-13 06:43:48 UTC
Hi Cor,

Thanks for your workaround guidiance, but it`s not an option to replace all pictures in our company documents. The only solution for now, is to send out a warning to all employees be aware of that bug and check the documents before printing and handing to a customer.

I tested one older version but it showed the same behaviour. That was a 4.2.6.x I think.

Thanks, Amon
Comment 10 Cor Nouws 2014-10-13 08:26:59 UTC
(In reply to amon from comment #9)

> Thanks for your workaround guidiance, but it`s not an option to replace all
> pictures in our company documents. The only solution for now, is to send out
> a warning to all employees be aware of that bug and check the documents
> before printing and handing to a customer.

I can understand that. Maybe it's an option for your company to pay someone to fix this? There are quite some developers that you could ask
 http://www.libreoffice.org/get-help/professional-support/

> I tested one older version but it showed the same behaviour. That was a
> 4.2.6.x I think.


Thanks for that extra check.
Cor
Comment 11 tommy27 2016-04-16 07:25:22 UTC Comment hidden (obsolete)
Comment 12 QA Administrators 2017-05-22 13:26:55 UTC Comment hidden (obsolete)
Comment 13 Sven-Jacobi 2018-02-16 09:14:44 UTC
Yes the cropping is broken in LO 5 and greater versions. The reason for this is that the cropping attribute (fo:clip) is dependant to the original size of the graphic. So in general the fo:clip attribute is broken. Other document formats (docx..) are saving croppings with relative values (percentage). They do not have a problem.

If now a graphic does not have dpi information saved LO is using the monitor resolution to calculate the original size of the graphic -> and this is wrong... 96DPI should be used in this case as it was the case in OO4.0.

This leads to the bug that if a image is cropped on one computer it might look different if opened with another computers.
Comment 14 QA Administrators 2021-05-23 04:20:18 UTC Comment hidden (obsolete)
Comment 15 V Stuart Foote 2021-05-23 15:14:39 UTC
Confirming this still is an issue at current master against 7.2.0.

Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 4a9eef7849a75ba91806886ea9c96d114c8d56f9
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Original STR were a little unclear.

Simply put LibreOffice is not handling the dimensions of the crop portion of an image held in ODF correctly.

In the test document, the coordinates from the "cropped" image are being extracted from a sd session with a full A4 page PNG image.  

That is, that an os/DE scale factor while applied to the VCL canvas is not handled correctly for an inserted image with sd cropping applied to an image held in the ODF archive.

If you extract the PNG from the attachment 107588 [details] ODT archive's Pictures folder, to open in draw and apply an sd crop. And then use that to paste into a new Writer document--and then scale the os/DE this is reproducible.

Apparent with FlatODT (attached a new sample) as well as an ODT archive.
Comment 16 V Stuart Foote 2021-05-23 15:23:00 UTC
Created attachment 172274 [details]
A test doc in Flat ODT

Open the attached with os/DE at current scale.  Then close LO and set os/DE to a new scale factor and reopen the document.  The proportion of the embedded sd "cropped" image that shows shifts.
Comment 17 Horst Schirmeier 2022-03-15 21:31:46 UTC
I just re-tested related bug #118299 with LO 7.3.1.3 and figured that the issue is gone; from the described symptoms I'd bet this one is, too.  Please re-test.
Comment 18 Stéphane Guillou (stragu) 2023-09-25 23:47:37 UTC
*** Bug 157407 has been marked as a duplicate of this bug. ***
Comment 19 Mihai Vasiliu 2023-09-26 07:40:22 UTC
I can reproduce in

Version: 7.6.1.2 (X86_64) / LibreOffice Community
Build ID: f5defcebd022c5bc36bbb79be232cb6926d8f674
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: ro-RO (ro_RO); UI: en-US
Calc: CL threaded

using the steps that I described in Bug 157407.

It reproduces in both Writer and Impress.
Comment 20 Mihai Vasiliu 2023-09-26 07:51:30 UTC
Created attachment 189824 [details]
odt with image crop scaling issue
Comment 21 GarnaPa 2023-12-15 19:05:10 UTC Comment hidden (spam)