Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 webP 格式的图像文件。如何以编程方式检查它是动画 webP 还是静态图像?
由于您在问题中添加了 fresco 标签,因此您可以使用以下实用程序:
ImageFormatChecker.getImageFormat_WrapIOException(encodedImage.getInputStream())应该返回 ImageFormat.WEBP_ANIMATED
ImageFormatChecker.getImageFormat_WrapIOException(encodedImage.getInputStream())
https://github.com/facebook/fresco/blob/master/imagepipeline-base/src/main/java/com/facebook/imageformat/DefaultImageFormatChecker.java#L125