docbook / xslTNG

DocBook xslTNG Stylesheets
https://xsltng.docbook.org
MIT License
41 stars 20 forks source link

Dimensions of scaled SVG Image are calculated wrong #432

Closed frank-steimke closed 5 months ago

frank-steimke commented 7 months ago

I have an SVG Image with an intrinsic size (given in the svg Element) of 24.1 x 9.4 Inch. For HTML and PDF it should be scaled by 25%. Using imagedata scale='25leads to an image in HTML which is way to small in HTML: width:144px;height:96px. This Issue is not related to the closed Issue 413, the result is still wrong even when i give intrinsic Dimension in Integer instaed of float. There are two options:

-Calculate the desired width and set it in DocBook imagedata/@width -Calculate the desired Dimensions and set them directly in SVG

I have checked with xslTNG 2.1.9 (outside of Oxygen). You can find my testcase in the attached archive. svg.zip.

Greetings, Frank

fsteimke commented 6 months ago

The dimensions are given in the svg file as width="24.09375in" and height="9.40625in". Both attributes are not part of the imageproperties that we get from ext:image-metadata. When i modify the svg file, so that dimensions are given in pixels without a unit (width="2313" height="903" ), everything is fine.

I think there is an issue in ext:image-metadata when dimensions are written as value with a unit.