easy-thumbnails icon indicating copy to clipboard operation
easy-thumbnails copied to clipboard

Workaround to prevent thumbnail creation for GIFs

Open wfehr opened this issue 6 years ago • 6 comments

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

wfehr avatar Oct 22 '18 11:10 wfehr

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.

wfehr avatar Oct 23 '18 05:10 wfehr

Any news on a possible release date?

wfehr avatar Jul 25 '19 05:07 wfehr

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.

jrief avatar Jul 25 '19 10:07 jrief

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?

wfehr avatar Jul 26 '19 04:07 wfehr

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.

jrief avatar Jul 26 '19 06:07 jrief

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.

Akiat avatar Jan 18 '21 12:01 Akiat

Animated GIFs will be supported in version 2.10, hence in my opinion there is no need for this feature anymore.

jrief avatar Sep 12 '24 09:09 jrief