Fix EXIF handling for tiff, heif, heic, and avif files

This commit is contained in:
Paul Friederichsen 2023-08-02 08:29:18 -05:00
parent 33db84c4d8
commit be7840074f
1 changed files with 2 additions and 2 deletions

View File

@ -535,11 +535,11 @@ def GenerateThumbnailBytesPIL( pil_image: PILImage.Image ) -> bytes:
def GetEXIFDict( pil_image: PILImage.Image ) -> typing.Optional[ dict ]: def GetEXIFDict( pil_image: PILImage.Image ) -> typing.Optional[ dict ]:
if pil_image.format in ( 'JPEG', 'TIFF', 'PNG', 'WEBP' ) and hasattr( pil_image, '_getexif' ): if pil_image.format in ( 'JPEG', 'TIFF', 'PNG', 'WEBP', 'HEIF', 'AVIF' ):
try: try:
exif_dict = pil_image._getexif() exif_dict = pil_image.getexif()._get_merged_dict()
if len( exif_dict ) > 0: if len( exif_dict ) > 0: