Skip to content

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

Open

Description

@litchfield

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.

Activity

  1. budlight commented on Dec 20, 2018

    @budlight

    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.

  2. litchfield commented on Dec 20, 2018

    @litchfield
    Author

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

  3. matthiask commented on Feb 6, 2019

    @matthiask
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions