-
Notifications
You must be signed in to change notification settings - Fork 323
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
Workaround to prevent thumbnail creation for GIFs #505
Conversation
@@ -113,7 +113,10 @@ def render(self, context): | |||
return self.bail_out(context) | |||
|
|||
try: | |||
thumbnail = get_thumbnailer(source).get_thumbnail(opts) | |||
if settings.THUMBNAIL_PREVENT_GIF_CONVERT and '.gif' in source.url: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather use
if settings.THUMBNAIL_PREVENT_GIF_CONVERT and '.gif' in source.url: | |
bits = os.path.splitext(source.url) | |
if settings.THUMBNAIL_PREVENT_GIF_CONVERT and bits[1] == '.gif': |
to explicitly state what's the intention.
Thanks for the quick review! I just pushed it with that changes. Edit: Forgot about the tests, trying to fix that.
is a reason for some tests to fail. |
Any news on a possible release date? |
You wrote:
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. |
For me it seems to solve a problem, which is too specific to one use-case. |
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. |
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