-
Notifications
You must be signed in to change notification settings - Fork 1k
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
get_image_metadata values for width and height are backwards for SVG images #1877
Comments
yep it looks reversed in the code |
Sorry about that; quite embarrassing. I can send a PR to fix it later today. Alternatively you can fix it by swapping zola/components/imageproc/src/lib.rs Line 587 in 96db523
There's also a typo in "Unfortunately" below that line that we could fix as well. |
@mre is swapping the w and the h the proper way of fixing this, or just a workaround that I could do? If that is the proper way of fixing it then I can do the pull request for you. (love rust! but still a newbie at using it) |
Yes, please go ahead. It's the proper way to do it in my opinion because my SVG Metadata crate returns the dimensions in swapped order and I don't want to change that because of other use cases. Perhaps you'd like to add a comment about that fact as well so people don't confuse it for a typo. |
Bug Report
Zola version: 0.15.3
It seems that get_image_metadata gets the width and height backwards? It may only be for svg images.
I was extending the imghover shortcode that I wrote, so that width and height are optional parameters, (since we can query this data with get_image_metadata)
You can see the result here: https://abridge.netlify.app/overview-images/#usage-same-path-1
and here is the repository: https://github.com/Jieiku/abridge
and here is the shortcode: https://github.com/Jieiku/abridge/blob/master/templates/shortcodes/imghover.html
The image in question is 600 width and 400 height, but get_image_metadata() report it the other way around.
The text was updated successfully, but these errors were encountered: