Bug 89289 - "Optimal row hight" shrinks picture anchored To Cell to minimal cell height
Summary: "Optimal row hight" shrinks picture anchored To Cell to minimal cell height
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.4.0 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: preBibisect, regression
Depends on:
Blocks:
 
Reported: 2015-02-10 14:56 UTC by Timur
Modified: 2018-03-06 14:48 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Picture anchored To Cell in XLSX created in MS Office (44.80 KB, application/vnd.openxmlformats-officedocument.spreadsheetxml)
2015-02-10 14:56 UTC, Timur
Details
Upper picture anchored to Page, lower picture anchored to Cell (58.00 KB, image/jpeg)
2015-02-11 15:26 UTC, Timur
Details
Picture anchored to Page visible, picture anchored to Cell NOT visible after Optimal Row Hight (36.28 KB, image/jpeg)
2015-02-11 15:27 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2015-02-10 14:56:10 UTC
Created attachment 113295 [details]
Picture anchored To Cell in XLSX created in MS Office

"Optimal row hight" command garbles picture in cell if picture is anchored To Cell.
That can be reproduced from scratch, if that picture is anchored To Cell. If other picture is anchored to Page it is normally seen.
In the attached XLSX file that was created in MS Office, pictures are already read as anchored To Cell.
Comment 1 raal 2015-02-11 10:04:14 UTC
I can not confirm with Version: 4.5.0.0.alpha0+
Build ID: 40432ac6caa478474d73786f95b808c14e106ff2
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-02-03_01:24:42


Please specify your version, OS and attach printscreen. Thank you.
Comment 2 Timur 2015-02-11 15:26:52 UTC
Created attachment 113312 [details]
Upper picture anchored to Page, lower picture anchored to Cell
Comment 3 Timur 2015-02-11 15:27:16 UTC
Created attachment 113313 [details]
Picture anchored to Page visible, picture anchored to Cell NOT visible after Optimal Row Hight
Comment 4 Timur 2015-02-11 15:31:02 UTC
To reproduce:
- insert 2 picture in Calc, one picture anchored to Page, other picture anchored to Cell (in different rows)
- select rows with pictures, right-click for "Optimal row hight", and OK on default value of 0,0 cm
- after Optimal row hight, you see that picture anchored to Page is visible, but picture anchored to Cell is NOT visible (shrunk to minimal cell height)
Comment 5 Timur 2015-02-11 15:47:06 UTC
Tested on Win7 64bit, LO 4.3.6 and 4.4.0. Seems that started with 3.4.0.1. and that was OK on 3.3.4.1. Regression? 
BTW, diff. versions seem that import pictures from attached file differently,  anchored to Cell or Page, so that has to be set first.
Comment 6 Matthew Francis 2015-02-16 08:14:12 UTC Comment hidden (obsolete)
Comment 7 Timur 2015-02-16 13:08:40 UTC Comment hidden (obsolete)
Comment 8 Timur 2015-02-17 09:16:58 UTC Comment hidden (obsolete)
Comment 9 Robinson Tryon (qubit) 2015-03-05 17:23:58 UTC Comment hidden (obsolete)
Comment 10 Robinson Tryon (qubit) 2015-12-10 01:26:24 UTC Comment hidden (no-value, obsolete)
Comment 11 Jean-Baptiste Faure 2016-04-10 20:51:43 UTC
Not sure if that is really a bug. The image is not inside the cell and if you protect the size of the image (right click on the image, choose Position and Size), it will not be crushed when you apply "Optimal row height".

Best regards. JBF
Comment 12 Xisco Faulí 2016-09-14 22:14:41 UTC Comment hidden (obsolete)
Comment 13 Xisco Faulí 2017-09-29 08:48:36 UTC Comment hidden (obsolete)
Comment 14 Timur 2017-09-29 17:19:26 UTC
Same in 6.0+ and same dilemma: is this a bug or not per comment 11, which has grounds.
MSO doesn't have this anchors, AFAIK. On picture Properties it has: 
- move and size with cells
- move but don't size with cells
- don't move or size with cells
MSO also doesn't seem to have Optimal Row Height (?) but we can put some small value there to test:
- move and size with cells behaves like Anchor to cell (picture shrunk)
- move but don't size with cells behaves like Anchor to page (picture intact)
- don't move or size with cells behaves like Protect Position and Size

I add Heiko to check. Maybe sometimes we can move from these anchor and protect terms to some descriptive result-oriented ones.
Comment 15 Heiko Tietze 2017-10-01 09:24:54 UTC
We must never distort images, that should only be done manually. But "Anchor > To cell" scales the image on resize of column or row. Doesn't happen for images anchored to the page.

My expectation is that an _anchored_ images keeps its size as it does in Writer. Default of row height there is 'Fit to size' taking the image into account. But it's possible to reduce the row height, where 'to character' shows the images in front of other content while 'as character' crops the bottom for smaller rows.
It makes sense to have only an equivalent of 'to character' in Calc. Meaning the image size is not bound to the cell size.

If we get _inline_ images, i.e. placed in the cell background, the situation is different. In that case the image scales and stretches with the cell size. And 'optimal row height' takes the image size into account, which doesn't in case of _anchored_.

(In reply to Timur from comment #14)
>- move and size with cells behaves like Anchor to cell (picture shrunk)
Rather the cell background 'inline' image
>- move but don't size with cells behaves like Anchor to page (picture intact)
Anchor to Cell
>- don't move or size with cells behaves like Protect Position and Size
Anchor to Page
Comment 16 Samuel Mehrbrodt (CIB) 2018-03-06 14:48:38 UTC
It's now possible to anchor images to cell without resizing them with the cell:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=acf0bad4e2b8c3c43aaaee8312c8a61d3552fcc2