Skip to content

Commit

Permalink
Handle tag_v2 in TiffImagePlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Sep 11, 2023
1 parent d0abab7 commit 1217b13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/PIL/ImageOps.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,10 +611,6 @@ def exif_transpose(image, *, in_place=False):
exif = exif_image.getexif()
if ExifTags.Base.Orientation in exif:
del exif[ExifTags.Base.Orientation]
if in_place and ExifTags.Base.Orientation in getattr(
exif_image, "tag_v2", {}
):
del exif_image.tag_v2[ExifTags.Base.Orientation]
if "exif" in exif_image.info:
exif_image.info["exif"] = exif.tobytes()
elif "Raw profile type exif" in exif_image.info:
Expand Down
2 changes: 2 additions & 0 deletions src/PIL/TiffImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,8 @@ def load_end(self):
exif.get_ifd(key)

ImageOps.exif_transpose(self, in_place=True)
if ExifTags.Base.Orientation in self.tag_v2:
del self.tag_v2[ExifTags.Base.Orientation]

def _load_libtiff(self):
"""Overload method triggered when we detect a compressed tiff
Expand Down

0 comments on commit 1217b13

Please sign in to comment.