easy-thumbnails
easy-thumbnails copied to clipboard
Workaround to prevent thumbnail creation for GIFs
Since a solution to preserve animations on GIFs is a bit tricky I made a little workaround to prevent thumbnail creaton for GIFs.
Issues for this problem: #184 and #217
Thanks for the quick review! I just pushed it with that changes.
Edit: Forgot about the tests, trying to fix that. Edit2: I changed the piece of code so tests are running again. Don't really understand why this
117 bits = os.path.splitext(getattr(source, 'url', source.name))
118 if settings.THUMBNAIL_PREVENT_GIF_CONVERT and bits[1] == '.gif':
is a reason for some tests to fail.
Any news on a possible release date?
You wrote:
Since a solution to preserve animations on GIFs is a bit tricky I made a little workaround to prevent thumbnail creation for GIFs.
Is there any way to detect, if a gif has animations? What kind of errors happen, if Pillow creates a thumbnail from an animated gif.
Is there any way to detect, if a gif has animations? What kind of errors happen, if Pillow creates a thumbnail from an animated gif.
Sorry for the misunderstanding: I didn't really try out how to solve the problem myself. I wrote this based on the comments in the above mentioned issues. What I meant is, if this workaround is going to be released?
For me it seems to solve a problem, which is too specific to one use-case. If this is really a problem for animated GIFs, then I would apply it only this class of images.
Really interested by this PR. I need to preserve GIF animation and it would be great to have this in the release.
Edit: I tried it, but the animation isn't preserved in my case.
Animated GIFs will be supported in version 2.10, hence in my opinion there is no need for this feature anymore.