-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WordPress image sizes for SVG #47
Labels
Milestone
Comments
As mentioned in my comments to the PR#44 #44 (comment) and #44 (comment), the root cause is WordPress core function The |
@darylldoyle any thoughts on how best to handle this issue? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When inserting SVG to the post, or using
wp_get_attachment_image()
function with custom image size ('large', 'medium', 'thumbnail', etc.) we always receive the full SVG src (which is normal) and incorrect (full-size or square) image dimensions in width and height attributes.Steps to Reproduce
Displaying SVG programmatically
Both resulting images have the same width and height. Expected to have 300x152 for medium size.
Adding SVG in Block Editor
Regardless of the selected Image Size in the Block Properties, the Image Dimensions remain the same (full size) and the resulting image still have full dimensions in width and height attributes. Expected to have
width="300" height="152"
in this exampleAdding SVG in Classic Editor
The image width and height attributes respect the selected size (medium) but represent the square 300x300. Expected to have the
height="152"
Environment information
Previous release Safe SVG 1.9.9
(or
develop
with mergedfix/23
)Code of Conduct
The text was updated successfully, but these errors were encountered: