Navigation Menu

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

Added IFD enum to ExifTags #6748

Merged
merged 5 commits into from Dec 13, 2022
Merged

Added IFD enum to ExifTags #6748

merged 5 commits into from Dec 13, 2022

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Nov 19, 2022

Helps #6641 by adding "named constants for common IFDs".

Adds the following to ExifTags.

class IFD(IntEnum):
    Exif = 34665
    GPSInfo = 34853
    Makernote = 37500
    Interop = 40965

I updated other parts of Pillow's code to use these new constants internally. In doing so, I found

if tag in [0x8769, 0x8225, 0x8825] and not isinstance(value, dict):

I can only imagine that 0x8225 was a typo when I added it in 4b14f01, so I'm removing it here.

Resolves #6777 by adding IFD.IFD1 as well, so that IFD1 data can be read, and then modifying get_child_images() to make use of IFD1 data to read thumbnails through the "ThumbnailOffset in IFD1".

src/PIL/Image.py Outdated Show resolved Hide resolved
@hugovk hugovk added the automerge Automatically merge PRs that are ready label Dec 13, 2022
@radarhere radarhere merged commit 5257d56 into python-pillow:main Dec 13, 2022
@radarhere radarhere deleted the exif_ifd branch December 13, 2022 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PRs that are ready Exif
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting IFD1 exif information
2 participants