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

Detect if gif is animated or static #20

Closed
BarbieBarb opened this issue Oct 19, 2014 · 3 comments
Closed

Detect if gif is animated or static #20

BarbieBarb opened this issue Oct 19, 2014 · 3 comments

Comments

@BarbieBarb
Copy link

I don't want to waste my time sliding the mouse up to a smiley to activate the animation... but discover that it is a static gif.

Animated gifs always have more than one frame.
Non-animated gifs do not.
Is there a way to detect if the gif has more than one frame... therefore allowing to alert those specific gifs ?
Thankyou

@LL25255252
Copy link

Try my style:
https://userstyles.org/styles/106194/gif-images-add-dashed-border-to-these-sites

The credit goes to Simonlindhoim idea ["Yeah, :not([src*=icon]) is not optimal, but it's better than nothing. "]

@BarbieBarb
Copy link
Author

Thanks LL25255252 but...
Not precise enough for me in the way I intend.
Example:
Post#6 https://greasyfork.org/forum/discussion/1799/pause-gifs-till-hover

The first image is animated gif (eyes blink) and the second image is static gif. I need to mark the first image as animated.
And the point of this thread is... I thought that detecting multiple frames in an image may be possible somehow.
Thankyou

@simonlindholm
Copy link
Owner

Mmm, this is hard. See #16 (which I'll count this as a dup of) and the linked comment in #10. Post 6 there also hits #3, FWIW.

If you want to code up hack for it (with all the caveats mentioned in that comment), the best way would be modify this extension (all the code is in bootstrap.js) and check if (getIc(imageElement).animated) at opportune times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants