matthewwithanm / django-imagekit

Automated image processing for Django. Currently v4.0
http://django-imagekit.rtfd.org/
BSD 3-Clause "New" or "Revised" License
2.26k stars 276 forks source link

Serializer representation crashes when missing image source #472

Closed lorinkoz closed 6 years ago

lorinkoz commented 6 years ago

I know this has been reported before in #461 #449 #259 however the out of the box behavior is not good. I am getting the same error just by adding a thumbnail to a DRF serializer. DRF is able to gracefully render null for non existing images and the url of the image when there is an image. Imagekit should probably be smart enough to do the same, otherwise we are all trapped in wrapping the code with if blocks for the super common of nullable image fields, which should be covered out of the box.

Anyways, thanks for all your hard work on this!!

vstoykov commented 6 years ago

Did you have any time with proposed changes that will resolve this?