Skip to content
Permalink
Browse files
actually use real exif data that can be used
  • Loading branch information
ralsina committed Jan 4, 2016
1 parent 21dfc0f commit 5e6f41c45878bd51a71b89c18c1da6ad0315c51c
Showing with 6 additions and 2 deletions.
  1. +6 −2 nikola/image_processing.py
@@ -70,6 +70,7 @@ def resize_image(self, src, dst, max_size, bigger_panoramas=True):
exif = im._getexif()
except Exception:
exif = None
_exif = im.info.get('exif')
if exif is not None:
for tag, value in list(exif.items()):
decoded = ExifTags.TAGS.get(tag, tag)
@@ -82,10 +83,13 @@ def resize_image(self, src, dst, max_size, bigger_panoramas=True):
elif value == 8:
im = im.rotate(90)
break
#if decoded == 'XResolution':
#self.logger.warning('POP')
#exif.pop(tag)
try:
im.thumbnail(size, Image.ANTIALIAS)
if exif is not None:
im.save(dst, exif=exif)
if _exif is not None:
im.save(dst, exif=_exif)
else:
im.save(dst)
except Exception as e:

0 comments on commit 5e6f41c

Please sign in to comment.