exif-py icon indicating copy to clipboard operation
exif-py copied to clipboard

KeyError 'E' in process_file

Open krzysieqq opened this issue 2 years ago • 1 comments

When I tried to parse the below image, I got KeyError 'E' from the line logger.debug("Endian format is %s (%s)", endian, {. I've processed the image by running exifread.process_file(image, details=False, stop_tag="DateTimeOriginal") command.

/usr/local/lib/python3.8/site-packages/exifread/__init__.py, line 147, in process_file
        return {}
    except InvalidExif as err:
        logger.debug(err)
        return {}
    endian = chr(ord_(endian[0]))
    # deal with the EXIF info we found
    logger.debug("Endian format is %s (%s)", endian, { …
        'I': 'Intel',
        'M': 'Motorola',
        '\x01': 'Adobe Ducky',
        'd': 'XMP/Adobe unknown'
    }[endian])

3

krzysieqq avatar Oct 16 '23 10:10 krzysieqq

@krzysieqq I think github image processing mangled whatever in your original image was triggering this (I couldn't provoke the crash with a download of it, in any case). I don't suppose you have the original hosted somewhere else? I put in a PR, but the image I used for testing (which was a webp) I don't have rights to, and the samples repo (https://github.com/ianare/exif-samples) requires all images uploaded to be CC-licensed.

rascalking avatar Apr 04 '24 00:04 rascalking