Skip to content

Commit 75ced54

Browse files
committedJul 18, 2016
Make partially-filtered case work
1 parent 84115e6 commit 75ced54

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎nikola/image_processing.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ def resize_image(self, src, dst, max_size, bigger_panoramas=True, preserve_exif_
128128
im = ImageOps.mirror(im)
129129
exif['0th'][piexif.ImageIFD.Orientation] = 1
130130

131-
# Filter EXIF data as required
132-
exif = self.filter_exif(exif, exif_whitelist)
133131
try:
134132
im.thumbnail(size, Image.ANTIALIAS)
135133
if exif is not None and preserve_exif_data and '0th' in exif:
136134
# Put right size in EXIF data
137135
w, h = im.size
138-
exif["0th"][piexif.ImageIFD.XResolution] = (w, 1)
139-
exif["0th"][piexif.ImageIFD.YResolution] = (h, 1)
136+
exif["0th"][piexif.ImageIFD.ImageWidth] = (w, 1)
137+
exif["0th"][piexif.ImageIFD.ImageLength] = (h, 1)
138+
# Filter EXIF data as required
139+
exif = self.filter_exif(exif, exif_whitelist)
140140
im.save(dst, exif=piexif.dump(exif))
141141
else:
142142
im.save(dst)

0 commit comments

Comments
 (0)
Please sign in to comment.