Skip to content
Permalink
Browse files
Make partially-filtered case work
  • Loading branch information
ralsina committed Jul 18, 2016
1 parent 84115e6 commit 75ced5457a9219060fc0b8b33c0d0222abd3b77a
Showing with 4 additions and 4 deletions.
  1. +4 −4 nikola/image_processing.py
@@ -128,15 +128,15 @@ def resize_image(self, src, dst, max_size, bigger_panoramas=True, preserve_exif_
im = ImageOps.mirror(im)
exif['0th'][piexif.ImageIFD.Orientation] = 1

# Filter EXIF data as required
exif = self.filter_exif(exif, exif_whitelist)
try:
im.thumbnail(size, Image.ANTIALIAS)
if exif is not None and preserve_exif_data and '0th' in exif:
# Put right size in EXIF data
w, h = im.size
exif["0th"][piexif.ImageIFD.XResolution] = (w, 1)
exif["0th"][piexif.ImageIFD.YResolution] = (h, 1)
exif["0th"][piexif.ImageIFD.ImageWidth] = (w, 1)
exif["0th"][piexif.ImageIFD.ImageLength] = (h, 1)
# Filter EXIF data as required
exif = self.filter_exif(exif, exif_whitelist)
im.save(dst, exif=piexif.dump(exif))
else:
im.save(dst)

0 comments on commit 75ced54

Please sign in to comment.