Handle tag_v2 in TiffImagePlugin

This commit is contained in:
Andrew Murray 2023-09-11 19:02:17 +10:00
parent d0abab7997
commit 1217b13b9e
2 changed files with 2 additions and 4 deletions

View File

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

View File

@ -1220,6 +1220,8 @@ class TiffImageFile(ImageFile.ImageFile):
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