Describe the bug
Trying to upload a SVG file in any image field in an article or category return a form validation error:
Upload a valid image. The file you uploaded was either not an image or a corrupted image.
Despite the SVG created from Demo are properly saved and working on frontend.
Environment
Describe your environment:
Plateform: Linux
Python version: 3.8
Django version: 4.0
However this should be an issue on any plateform, Python and Django versions.
To Reproduce
Steps to reproduce the behavior:
Go to the create/edit form for Article or Category
Fill required fields and at least one image field with a SVG file
Submit form
Form validation return an error
Expected behavior
SVG file support was thought to be ok since the demo create some ones. But SVG does not seems to be explicitely tested on model, however the model itself may not perform any validation, it may be only done from form validator (this is something to ensure). And so this issue was hided until some front tests have been done.
So finally the expected behavior is that we should be able to upload SVG files.
This is a well known problem that ImageField does not support SVG since it validate file with PIL. A workaround is to use FileField instead with a basic file extension/mime validator to reject non image files.
Implementation of smart image management from #11 should resolve this since it was its first purpose.
Describe the bug Trying to upload a SVG file in any image field in an article or category return a form validation error:
Despite the SVG created from Demo are properly saved and working on frontend.
Environment Describe your environment:
However this should be an issue on any plateform, Python and Django versions.
To Reproduce Steps to reproduce the behavior:
Expected behavior SVG file support was thought to be ok since the demo create some ones. But SVG does not seems to be explicitely tested on model, however the model itself may not perform any validation, it may be only done from form validator (this is something to ensure). And so this issue was hided until some front tests have been done.
So finally the expected behavior is that we should be able to upload SVG files.
This is a well known problem that ImageField does not support SVG since it validate file with PIL. A workaround is to use FileField instead with a basic file extension/mime validator to reject non image files.
Implementation of smart image management from #11 should resolve this since it was its first purpose.