Skip to content

Restored Makernote as a deprecated enum #8629

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

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

radarhere
Copy link
Member

#8615 replaced ExifTags.IFD.Makernote with ExifTags.IFD.MakerNote.

#8614 (comment) has requested that we keep ExifTags.IFD.Makernote for now, as a deprecated enum.

@@ -353,6 +353,7 @@ class IFD(IntEnum):
Exif = 0x8769
GPSInfo = 0x8825
MakerNote = 0x927C
Makernote = 0x927C # Deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we raise a deprecation warning when accessed?

We've had problems before, removing VERSION after only deprecating in docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried __getattr__, __getitem__ and @property, and I don't think so, no.

It was only added in #6748 in Pillow 9.4.0, so I would expect this to have smaller use.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking.

Yeah, I expect this should cause much less breakage.

Still, if we can't warn in code, perhaps we should just deprecate this without planning to remove it? It doesn't cost anything to keep this one line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean just restore the enum value, and add a comment? Done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and we can also document it as deprecated, but don't mention any removal date:

-``ExifTags.IFD.Makernote`` has been deprecated and will be removed in Pillow 13
-(2026-10-15). Instead, use ``ExifTags.IFD.MakerNote``.
+``ExifTags.IFD.Makernote`` has been deprecated. Instead, use ``ExifTags.IFD.MakerNote``.

@radarhere
Copy link
Member Author

Something to be aware of - with the current state of this PR,

from PIL import ExifTags
print(ExifTags.IFD.Makernote)

will give

IFD.MakerNote

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@hugovk hugovk added the automerge Automatically merge PRs that are ready label Dec 30, 2024
@radarhere radarhere merged commit 7d5ccff into python-pillow:main Dec 30, 2024
49 checks passed
@radarhere radarhere deleted the makernote branch December 30, 2024 10:52
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.

2 participants