Skip to content

Max attachment image size breaks thumbnails #1976

@rafalp

Description

@rafalp

Repro:

Upload image file larger than attachment_image_max_width and attachment_image_max_height, that after scaling down will still be valid for thumbnail. 1280 x 4000 file size is guaranteed to trigger it

This will cause resize routine to scale down uploaded image, changing its format attribute to None. generate_attachment_thumbnail will then crash with ValueError: unknown file extension:

Solution: add image_format: str attribute to generate_attachment_thumbnail

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: backendThis issue involves Python, Django or dependency (eg. database)bughelp wanted

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions