Created attachment 122225 [details] sample Steps to reproduce: 1. Open attached file where the 3 images have different widths and heights
Created attachment 122226 [details] comparison Firefox and Libreoffice
Created attachment 122264 [details] not squared embedded image
Created attachment 122297 [details] Example with preserveAspectRatio The image element has no attribute preserveAspectRatio. In such cases the default value "xMidYMid meet" has to be used, see end of section 5.7 in https://www.w3.org/TR/SVG/struct.html#ImageElement If the attribute preserveAspectRatio="xMidYmid meet" is set in the image element, then the rendering is correct. Therefore the error is, that in case of missing attribute the default is not used. I have not looked yet, where in the source this is. I have used an example with a linked image, so you can be sure, that it is in all cases the same image. The package contains the png image, the two svg images (one with attribute, the other without) and a Draw document which links the svg images.
It seems to be in /core/svgio/source/svgreader/svgimagenode.cxx the part around 293 else 294 { 295 // create mapping 296 const SvgAspectRatio& rRatio = getSvgAspectRatio(); 297 298 if(rRatio.isSet()) 299 In case rRatio.isSet() results in false, the default values have to be set, and then mapping outside the case differentiation. (I think so, but have not tested it.)
Armin Le Grand committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=080e5f2f24513e871f2563c88a69fa8a9ecfe0eb SVGIO: tdf#97383: Keep ratio in embedded images... It will be available in 5.2.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 gess we can already close this.