Skip to content

Commit

Permalink
Updated MakerNote IFD capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 21, 2024
1 parent a7338f8 commit b99a00f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/PIL/ExifTags.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ class Interop(IntEnum):
class IFD(IntEnum):
Exif = 34665
GPSInfo = 34853
Makernote = 37500
MakerNote = 37500
Interop = 40965
IFD1 = -1

Expand Down
8 changes: 4 additions & 4 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3884,7 +3884,7 @@ class Exif(_ExifBase):
gps_ifd = exif.get_ifd(ExifTags.IFD.GPSInfo)
print(gps_ifd)
Other IFDs include ``ExifTags.IFD.Exif``, ``ExifTags.IFD.Makernote``,
Other IFDs include ``ExifTags.IFD.Exif``, ``ExifTags.IFD.MakerNote``,
``ExifTags.IFD.Interop`` and ``ExifTags.IFD.IFD1``.
:py:mod:`~PIL.ExifTags` also has enum classes to provide names for data::
Expand Down Expand Up @@ -4047,11 +4047,11 @@ def get_ifd(self, tag: int) -> dict[int, Any]:
ifd = self._get_ifd_dict(offset, tag)
if ifd is not None:
self._ifds[tag] = ifd
elif tag in [ExifTags.IFD.Interop, ExifTags.IFD.Makernote]:
elif tag in [ExifTags.IFD.Interop, ExifTags.IFD.MakerNote]:
if ExifTags.IFD.Exif not in self._ifds:
self.get_ifd(ExifTags.IFD.Exif)
tag_data = self._ifds[ExifTags.IFD.Exif][tag]
if tag == ExifTags.IFD.Makernote:
if tag == ExifTags.IFD.MakerNote:
from .TiffImagePlugin import ImageFileDirectory_v2

if tag_data[:8] == b"FUJIFILM":
Expand Down Expand Up @@ -4138,7 +4138,7 @@ def get_ifd(self, tag: int) -> dict[int, Any]:
ifd = {
k: v
for (k, v) in ifd.items()
if k not in (ExifTags.IFD.Interop, ExifTags.IFD.Makernote)
if k not in (ExifTags.IFD.Interop, ExifTags.IFD.MakerNote)
}
return ifd

Expand Down

0 comments on commit b99a00f

Please sign in to comment.