Skip to content

Catch more exceptions when Exif broken #3

Closed
@lizequn

Description

@lizequn

Hi,
Thanks for providing this useful tool, I'm using it to generate compressed images in NAS devices.

had_exif = True if piexif.load(t.src_path)['Exif'] else False

The 'piexif.load()' you used to get exif may raise a lot of different exceptions when exif head is broken(e.g. struct.error: unpack requires a buffer of n bytes). The program need to catch those, otherwise it will corrupted.

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