Skip to content

Dimensions check does not work #9

@rubicon9

Description

@rubicon9

image = Image.open(value.filename)
w, h = image.size
image.close()

As per snippet:

  1. The object passed for validation as value is a FileObject from a form submission; filename does not reference the file path.
    Suggest: image = Image.open(value)

  2. Closing the image causes problems for downstream stream processing.
    Instead suggest removing image.close() and replacing with value.seek(0)

Tests will also need to be updated to reflect these changes.

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