【问题标题】:Fresco - How to check if a file is animated webP or not progrmmatically?Fresco - 如何以编程方式检查文件是否以 webP 为动画?
【发布时间】:2021-03-03 22:09:38
【问题描述】:

我有一个 webP 格式的图像文件。如何以编程方式检查它是动画 webP 还是静态图像?

【问题讨论】:

    标签: android imageview fresco image-rendering animated-webp


    【解决方案1】:

    由于您在问题中添加了 fresco 标签,您可以使用以下实用程序:

    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

    【讨论】:

      猜你喜欢
      • 2010-11-27
      • 2021-01-13
      • 2016-12-21
      • 1970-01-01
      • 2011-05-30
      • 2011-12-10
      • 2013-05-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多