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
Fix #2094 - scaling and colorbox of SVG thumbnails #2101
Conversation
tree.attrib['width'] = "%ipx" % w | ||
tree.attrib['height'] = "%ipx" % h | ||
tree.attrib['viewport'] = "0 0 %ipx %ipx" % (w, h) | ||
if dst.endswith('.tgz'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn’t this be svgz?
Sorry, the tgz was a mistake of course. |
LGTM, Any comments @Aeyoun ? If not, let's merge this on monday. |
Looks saner than most things involving SVGs. 👍 |
Ok, @TyberiusPrime add a one-line in CHANGES, add yourself to AUTHORS, fix the conflict and ping me here, I'll merge. |
ping :) |
Fix #2094 - scaling and colorbox of SVG thumbnails
Merged, thanks for working on this! |
This change rescales SVGs by manipulating their width, height and viewport.
It extracts width and height from the parse tree, throws away the units, calculates aspect ratio
and rewrites them accordingly in px.
To enable colorbox-functionality for SVG thumbnails, the thumbnail plugin confuses docutils
to treat svgs like other images by appending a '?' to the uri.