Skip to content

Commit

Permalink
Use _getexif instead of getexif in order to get always all exifdata.
Browse files Browse the repository at this point in the history
See python-pillow/Pillow#5863 for explanation.
  • Loading branch information
EddyXorb committed Dec 12, 2022
1 parent 9a6ca46 commit a18bcb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/image/imagefile.py
Expand Up @@ -44,17 +44,21 @@ def readDateTime(self):
try:
date = None
img = Image.open(self.getJpg())
img_exif = img.getexif()
img_exif = img._getexif()
exifvalueOriginalCreation = 36867
exifValueDigitized = 36868
exifvalueChangedDate = 306
if img_exif is None or (
exifvalueOriginalCreation not in img_exif
and exifValueDigitized not in img_exif
and exifvalueChangedDate not in img_exif
):
return None
else:
if exifvalueOriginalCreation in img_exif:
date = img_exif[exifvalueOriginalCreation]
elif exifValueDigitized in img_exif:
date = img_exif[exifValueDigitized]
else:
date = img_exif[exifvalueChangedDate]

Expand Down

0 comments on commit a18bcb9

Please sign in to comment.