Skip to content

Commit

Permalink
Merge pull request #2753 from getnikola/handle-animated-gifs
Browse files Browse the repository at this point in the history
Handle animated gifs
  • Loading branch information
ralsina committed May 10, 2017
2 parents 77ddb6f + c45251c commit 4bd99d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions nikola/image_processing.py
Expand Up @@ -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
Expand Down

0 comments on commit 4bd99d3

Please sign in to comment.