safe-svg
safe-svg copied to clipboard
SVG dimensions broken after 2.2.3
Describe the bug
Dear developers,
after the 2.2.3 version, the dimensions of images are broken. The plugin doesn't seem to detect svg width, height, viewbox dimensions properly anymore, and instead pulls values from the actual drawing (path). This breaks layouts, because for example width and height for a svg image set that was dimensioned using padding are now wrong.
Please look into this as this might affect a lot of people.
Best regards, Andrej
Steps to Reproduce
Example: SVG with <svg width="54.529" height="50.001" version="1.1" viewBox="0 0 54.529 50.001" xmlns="http://www.w3.org/2000/svg"> gets detected as "Dimensions: 46 by 50 pixels", because that is the size of the path inside it. See example for more info:
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct