Skip to content

Fix all issues with image formats & add tests #847

@abandoned-prototype

Description

@abandoned-prototype

Recently we had problems with certain image-types not being recognized by imghdr.what which leads to errors, because we use that function extensively before uploading the image to S3. Additionally we also have an ALLOWED_EXTENSION config, which controls what image filename extensions are allowed when uploading an image.
Unfortunately it seems that #807 wasn't able to fix all the problems since we use the imghdr.what in a lot of places. So I think we need to come up with a solution that brings our logic on which image-types are allowed and how they are determined into one place.
Further, we need to write tests with a number of test-images to make sure things aren't breaking again as already pointed out by @redshiftzero in #807 (review)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions