Skip to content
Permalink
Browse files

Merge pull request #2753 from getnikola/handle-animated-gifs

Handle animated gifs
  • Loading branch information
ralsina committed May 10, 2017
2 parents 77ddb6f + c45251c commit 4bd99d31825360f36b2793c5858f3200efc4409b
Showing with 7 additions and 0 deletions.
  1. +1 −0 CHANGES.txt
  2. +6 −0 nikola/image_processing.py
@@ -30,6 +30,7 @@ Features
Bugfixes
--------

* Don't break animated GIFs in postprocessing (Issue #2750)
* More robust shortcodes, no need to escape URLs in reSt, work better
with LaTeX, etc.
* No longer creates empty subarchive pages, and no longer create broken
@@ -98,6 +98,12 @@ def resize_image(self, src, dst, max_size, bigger_panoramas=True, preserve_exif_
self.resize_svg(src, dst, max_size, bigger_panoramas)
return
im = Image.open(src)

if hasattr(im, 'n_frames') and im.n_frames > 1:
# Animated gif, leave as-is
utils.copy_file(src, dst)
return

size = w, h = im.size
if w > max_size or h > max_size:
size = max_size, max_size

0 comments on commit 4bd99d3

Please sign in to comment.
You can’t perform that action at this time.