Skip to content

Commit

Permalink
actually use real exif data that can be used
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Jan 4, 2016
1 parent 21dfc0f commit 5e6f41c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nikola/image_processing.py
Expand Up @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit 5e6f41c

Please sign in to comment.