Skip to content
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

Upload svg in image field, "width cannot be null" #91

Open
eminos opened this issue Dec 3, 2017 · 2 comments
Open

Upload svg in image field, "width cannot be null" #91

eminos opened this issue Dec 3, 2017 · 2 comments

Comments

@eminos
Copy link

eminos commented Dec 3, 2017

When uploading an svg file into an image type field it gives the SQL error "width cannot be null".

@weotch
Copy link
Member

weotch commented Dec 4, 2017

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.

@eminos
Copy link
Author

eminos commented Dec 4, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants