Closed benoit74 closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
1eddabc
) to head (c8e2a08
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Fix #113
Changes:
convert_svg2png
function to convert SVG to PNGconvert_image
API for three reasons. First it would make the code ofconvert_image
more complex since we would have to first probe for image format to know if it is SVG (this is for now handled internally in PIL library, but does not work for SVG). Second because the conversion is almost always requiring to pass output width/height and these are different parameters for CairoSVG than for PIL, so the "user" already need to know that he is converting a SVG. Third because current need (convert SVG icon of websites in warc2zim) is only focused on conversion to PNG whileconvert_image
is far more generic ; and CairoSVG does not have a generic conversion function, only conversion to a given format.Nota: https://github.com/openzim/python-scraperlib/pull/178 must be reviewed and merged first, these changes are based on this other PR