Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError 'E' in process_file #188

Open
krzysieqq opened this issue Oct 16, 2023 · 1 comment
Open

KeyError 'E' in process_file #188

krzysieqq opened this issue Oct 16, 2023 · 1 comment

Comments

@krzysieqq
Copy link

krzysieqq commented Oct 16, 2023

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

@rascalking
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants