mikeboers / Flask-Images

On-demand resizing of images for Flask applications.
https://mikeboers.github.io/Flask-Images/
BSD 3-Clause "New" or "Revised" License
81 stars 43 forks source link

Animated GIF loses transparency and animation #14

Open CatarinaPBressan opened 10 years ago

CatarinaPBressan commented 10 years ago

When I include my gif using url_for('static', filename='loading.gif'), the animation and the transparency work as expected, but they stop working when I use Flask-Images' url_for('images', filename='loading.gif', height=50 ). Flask-Images does successfully resize the image, though.

Testing with this gif:

http://imgur.com/2D7aWd3.gif

mikeboers commented 10 years ago

PIL is notoriously bad at handling animated GIFs.

But it can be done, and (for my own reference) there is some code at http://visvis.googlecode.com/hg/vvmovie/images2gif.py which may help in this regard.

CatarinaPBressan commented 10 years ago

Nice to know that it's possible, but since I can't see where I hook things up, I think it will be easier if I just manually resize that gif. Thank you!