Upload svg in image field, "width cannot be null"
When uploading an svg file into an image type field it gives the SQL error "width cannot be null".
Here is where the width is measured: https://github.com/BKWLD/decoy/blob/master/classes/Models/Image.php#L193
I could do something like:
https://stackoverflow.com/a/14105726/59160
Or maybe allow width / height to be null ... I don't think Decoy ever does anything with those values, so I think they could be null.
I have made width and height columns in the DB table nullable. That kinda solved the problem, and now svg files are uploadable in an image field. But then I've noticed two other bugs:
- The image is not shown/previewed in the field in Decoy.
- Some error in the console.
I think Decoy is trying to make a thumbnail of the uploaded image, which fails with svg files.