Skip to content

Commit

Permalink
Copy EXIF data to resized images (fix #2204)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Jan 4, 2016
1 parent 1b620db commit d31e8e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -14,6 +14,8 @@ Features
Bugfixes
--------

* Preserve EXIF data when resizing images (Issue #2204)

New in v7.7.4
=============

Expand Down
5 changes: 4 additions & 1 deletion nikola/image_processing.py
Expand Up @@ -84,7 +84,10 @@ def resize_image(self, src, dst, max_size, bigger_panoramas=True):
break
try:
im.thumbnail(size, Image.ANTIALIAS)
im.save(dst)
if exif is not None:
im.save(dst, exif=exif)
else:
im.save(dst)
except Exception as e:
self.logger.warn("Can't thumbnail {0}, using original "
"image as thumbnail ({1})".format(src, e))
Expand Down

0 comments on commit d31e8e6

Please sign in to comment.