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
Svg conversion png #648
Svg conversion png #648
Conversation
@rodrigolourenco It's better to keep cairoSVG outside the setup.py and only add svg support if carioSVG is available. |
@guilhermef Removed cairosvg from setup.py and checked if svg conversion to png is available. |
@rodrigolourenco I need you to rebase this PR. |
@guilhermef done, PR updated. |
thanks @rodrigolourenco |
It seems to me that many SVGs start with an XML preabmble (i.e. Example: https://upload.wikimedia.org/wikipedia/commons/b/b0/NewTux.svg |
SVG detection in Exiftool: https://sourceforge.net/p/exiftool/code/ci/master/tree/lib/Image/ExifTool/XMP.pm#l3732 |
Looks like these times it is safe to just look for an svg element with the proper namespace URL (https://phabricator.wikimedia.org/T43174), PR: #677 |
Svg conversion png
Added support on Thumbor for svg conversion on png.
Using the Cairo (http://cairographics.org/) library with the python library CairoSVG (http://cairosvg.org/) for conversion. Now, Thumbor was capable for doing this transparent verifying the mime type of the image and applying a conversion.
Sample:
http://localhost:8888/unsafe/https://upload.wikimedia.org/wikipedia/commons/2/2f/Google_2015_logo.svg