You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 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
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
I've tested this on a local environment and have not been able to reproduce. The supplied SVG file in the issue description is protected and cannot be downloaded, but I've tried against 5 different SVGs from different sources with no luck. width and height attributes are extracted from the viewBox attribute and are correct as far as I can see.
If there is an SVG that should be tested specifically, please provide it for reference.
I have tested this on a brand new site and behavior was indeed correct. So I analyzed the problematic sites and discovered:
2.2.2 probably reads info directly from the file (because the dimensions are not rounded to whole pixels)
2.2.3+ reads info from metadata which had incorrect dimensions
Since files were uploaded years ago, its impossible to know why the dimensions in database were incorrect. The simplest solution was using wp media regenerate on problematic files and now the newest version works flawlessly.
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 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
The text was updated successfully, but these errors were encountered: