respondcreate / django-versatileimagefield

A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for quickly creating new images from the one assigned to the field.
http://django-versatileimagefield.readthedocs.io/
MIT License
531 stars 90 forks source link

Crash on dodgy image files (OSErrors and such) #125

Open litchfield opened 6 years ago

litchfield commented 6 years ago

In a large production deployment, we found some image files were crashing PIL. We didn't like that, and neither did our users.

Pull request #124 adds a new setting, VERSATILEIMAGEFIELD_CRASH_ON_BAD, default True to match current behaviour, for backwards compatibility.

Set it to False, and it will (won't?) do what it says on the tin. Crises (plural) averted. It'll still raise a warning though, in case you're interested.

budlight commented 5 years ago

this should be merged its literally insane that the whole app crashes if it can't find an image or there is some error with it. It should default to False because it is a potential denial of service condition if someone uploads a dodgy image.

litchfield commented 5 years ago

@budlight tell me about it! It's been 9 months. I'm wondering if anyone actually uses this thing for anything even half serious?

matthiask commented 5 years ago

This misbehavior (which is inherited from Django's ImageField) was the reason for me to finally bite the bullet and write my own imagefield. The code to check images on upload isn't very hard to write, but it was a bit tricky.

Anyway, just putting this out there. Using django-versatileimagefield was a pleasure, but I moved to something different.