Closed sveetch closed 1 year ago
We will need a library to guess image type for validation so we can either it from Pillow for common image types and switch to something else for SVG.
There are some good packages to guess mime type:
I say, let's start with puremagic, all in all it will have to be tested against various files to see if false positive are rare or not.
Finally, the magic guess library implementation may be flexible enough to switch or enable other solutions if needed.
We need also something for SVG validation, something simple enough to not require for an heavy library like svglib which stands of reportlab (this is a huge no).
Features has been ported to a package https://github.com/sveetch/django-smart-media since it may be useful elsewhere.
Done in 0.5.0 pre-16, will be available in 0.5.0 release yet to come
Alike in cmsplugin-block, it would add nice upload fields, image thumbnailer and svg support.