When inserting an image in Calc, and changing its anchor to "Cell", the image is resized when the column/row is resized. However, the aspect ratio is not kept and the image gets distorted. When resizing a cell, the image inside should be resized keeping the aspect ratio.
Samuel: what do you think of bug 46868 vs. bug 54769?
(In reply to Buovjaga from comment #1) > Samuel: what do you think of bug 46868 vs. bug 54769? Hm both bugs sound valid. I like that images get scaled automatically with the cell, but would suggest the following improvements: * Always keep the aspect ratio of the image (as described in comment 0) * Only resize the image if it fits into the cell. If it's already larger than the cell, ignore it * Add an option to *not* resize with the cell (as suggested in bug 46868). Maybe a third anchor type is the way to go, like "Anchor to cell, no automatic resize"
(In reply to Samuel Mehrbrodt (CIB) from comment #2) > * Add an option to *not* resize with the cell (as suggested in bug 46868). > Maybe a third anchor type is the way to go, like "Anchor to cell, no > automatic resize" For comparison, Excel also has three modes, namely: * Dependent on cell position and size (matching our current cell anchoring) * Dependent on cell position (default, no match in LO) * Independent on cell position and size (matching our page anchoring)
Hi Samuel, I have read in https://gerrit.libreoffice.org/#/c/49490/, that you are going to introduce a new attribute, "This adds a new loext:resize-with-cell attribute for ODF to the draw:frame element." Please describe, how this new attribute will interact with already existing attributes 19.627 table:end-cell-address 19.632 table:end-x 19.633 table:end-y The UI in Excel and Gnumeric have these settings: A Don't move or size with cells (Excel), Absolute size and position (Gnumeric). That is "anchor to page" in LibreOffice. B Move and size with cells (Excel), Move and resize with cells (Gnumeric). C Move but don't size with cells(Excel), Move with cells (Gnumeric). Gnumeric sets the attribute "table:end-cell-address" in case of B in ODF. So Gnumeric solves the size problem without introducing a new attribute. From my understanding, you get the case C, if no additional attribute is used on the frame. Then the size is determined by svg:width and svg:height. Only LibreOffice does currently not respect the fixed size.
(In reply to Regina Henschel from comment #4) > Hi Samuel, I have read in https://gerrit.libreoffice.org/#/c/49490/, that > you are going to introduce a new attribute, "This adds a new > loext:resize-with-cell attribute for ODF to the draw:frame element." > > Please describe, how this new attribute will interact with already existing > attributes > 19.627 table:end-cell-address > 19.632 table:end-x > 19.633 table:end-y > > The UI in Excel and Gnumeric have these settings: > A > Don't move or size with cells (Excel), Absolute size and position (Gnumeric). > That is "anchor to page" in LibreOffice. > B > Move and size with cells (Excel), Move and resize with cells (Gnumeric). > C > Move but don't size with cells(Excel), Move with cells (Gnumeric). > > Gnumeric sets the attribute "table:end-cell-address" in case of B in ODF. So > Gnumeric solves the size problem without introducing a new attribute. > > From my understanding, you get the case C, if no additional attribute is > used on the frame. Then the size is determined by svg:width and svg:height. > Only LibreOffice does currently not respect the fixed size. Hi Regina, saw your comment just now. Will read the docs and see if I can implement it the same way as gnumeric does. Is there any definition in ODF when the table:end-cell-address is to be used?
I support the ideas in comment 2 with the addition of 3 possible options like Excel, described in comment 3. I set the bug to NEW despite that I think it duplicated the other 2 bugs. If this issue is fixed, the other 2 will be also fixed. :)
(In reply to Samuel Mehrbrodt (CIB) from comment #5) > Hi Regina, saw your comment just now. > Will read the docs and see if I can implement it the same way as gnumeric > does. > Is there any definition in ODF when the table:end-cell-address is to be used? So I found out that table:end-cell-address etc was always written before. I now changed the patch to write it only when "resize with cell" is selected. So it's now the same as in Gnumeric (Tested that Gnumeric recognizes our three options correctly).
Samuel Mehrbrodt committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=acf0bad4e2b8c3c43aaaee8312c8a61d3552fcc2 tdf#114552 Add a third anchor type for calc graphics It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Samuel Mehrbrodt committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=782d504649ccb2dbe1a55d7abdf5c532b62f5c39 tdf#114552 Add unit test for ODF Import of anchor types It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Samuel Mehrbrodt committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=4f29ce6a67b81e7f28e1c86d60ff15ec1d180661 tdf#114552 Improve image scaling in Calc It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Samuel Mehrbrodt committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=1a7444ed69a68696b05feb3f3618b6704a140ba6 tdf#114552 Convert anchor toggle to anchor menu It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I consider this fixed now. Please test the changes and report back.
Samuel Mehrbrodt committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=6ae7b9d40ca24c9c9fbad6346a4dd9112894dc49 tdf#114552 Also reduce the anchor offset when shrinking images It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.