This is a fallback when FastImage cannot be used (animated WEBP images).
animated? is always called with
@file as an argument, so the arg should probably be removed. Especially since this method makes an assumption that there’s just one file (by storing frame count in an instance variable)
Maybe instead of memoizing just the frame count we could save the resulting boolean? (in
I don’t understand this
I want to use this method to detect animated
webp but it’s running only when type is different from
Yes, sorry, my mistake. I did not rewrite the condition when I refactored the early return.
Maybe you meant to test only if it’s different from
gif? Since that is supported by FastImage anyway.
gif just as a failsafe.