Open styfle opened 3 weeks ago
Maybe we could add a isAnimatedImage
property in addition to ext
and mime
. That could be useful for GIF too.
Yeah that would be great!
In particular, I'm looking to replace is-animated
which supports GIF, PNG, WebP, but it would also be great to support AVIF as well.
Maybe handy for some users, but putting that in we move to an unclear scope.
What makes isAnimatedImage a relevant file property in module which detects the file type? Why not add the width and height, or the bitrate for audio files.
I see what you mean.
Perhaps additional metadata would be opt-in onl. That way, existing use cases that only need the file type can early exit once that’s determined.
Description
I see that APNG support was added in PR https://github.com/sindresorhus/file-type/pull/215 which is great to detect the difference between a static PNG and animated PNG. This works great because they each have their own file extension and mime type.
However, I can't seem to find any way to differentiate static vs animated WebP images because the file extension and mime type are the same for both.
Is that possible using this package? If not, consider this a feature request 😃
Existing Issue Check
File-Type Scope Acknowledgment