Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle animated gifs #2753

Merged
merged 2 commits into from May 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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