-
-
Notifications
You must be signed in to change notification settings - Fork 711
Open
Labels
Description
Bug report
Describe the bug
The following SVG uses the "mm" units, and renders incorrectly:
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
<rect x="0" y="0" width="13.22mm" height="13.22mm" fill="red" />
<rect x="50" y="50" width="13.22mm" height="13.22mm" fill="blue" />
</svg>
This is what it looks like with pyvips (3.0.0):

This is what it looks like when converted with rsvg-convert (v2.58.0) and in both Chrome / Firefox:

From what I can tell, it seems like the units are scaled down by a factor of 1.33.
I also tried playing around with the dpi
and scale
parameters of the svgload
function, but they only scale the resulting image, without affecting the content within.
To Reproduce
Save the provided svg to "test-units.svg", and then run the following python script:
import pyvips
image = pyvips.Image.svgload('test-units.svg')
image.write_to_file('test-units-py.png')
Environment
(please complete the following information)
- OS: Windows 11
- pyvips: 3.0.0
- pyvips-binary: 8.17.1