We wrap any files ending in .gif in amp-anim but the GIF format supports more than just animated images. It would be nice to handle these cases.
the GIF format supports more than just animated images
Such as a non-animated transparent GIF? What else would there be to support?
To detect whether or not a GIF is animated, this may depend on a core patch, such as 28474.2.diff. We'd then probably need to cache whether it is animated in _wp_attachment_metadata postmeta.
We should re-open this when https://core.trac.wordpress.org/ticket/28474 is landed in core.