简体   繁体   English

Fresco - 如何检查文件是否以编程方式为 webP 动画?

[英]Fresco - How to check if a file is animated webP or not progrmmatically?

I have an image file of webP format.我有一个 webP 格式的图像文件。 How can I check if it is animated webP or a static image programmatically?如何以编程方式检查它是动画 webP 还是 static 图像?

Since you added fresco tag to the question, you could use the following utility:由于您在问题中添加了 fresco 标签,因此您可以使用以下实用程序:

ImageFormatChecker.getImageFormat_WrapIOException(encodedImage.getInputStream()) should return ImageFormat.WEBP_ANIMATED ImageFormatChecker.getImageFormat_WrapIOException(encodedImage.getInputStream())应该返回 ImageFormat.WEBP_ANIMATED

https://github.com/facebook/fresco/blob/master/imagepipeline-base/src/main/java/com/facebook/imageformat/DefaultImageFormatChecker.java#L125 https://github.com/facebook/fresco/blob/master/imagepipeline-base/src/main/java/com/facebook/imageformat/DefaultImageFormatChecker.java#L125

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM