ctrl-freaks / freezeframe.js

freezeframe.js is a library that pauses animated .gifs and enables them to animate on mouse hover / mouse click / touch event, or with trigger / release functions.
http://ctrl-freaks.github.io/freezeframe.js/
MIT License
1.41k stars 110 forks source link

Update check for whether an image is a gif (allow animated png and inline base64) #60

Closed alexbarnsley closed 4 years ago

alexbarnsley commented 4 years ago

Because the validateFilename method only checks file name/extension, it will incorrectly trigger the "Image is not a gif" when a base64 image is provided (e.g. src="data:image/gif;base64,..."). Also, it's now possible for png's to be animated too, so the extension check for "gif" I believe needs to be updated to do a more in-depth check (if/when possible).

Personally I would be happy with an option to disable warnings since freezeframe is working as expected.