zjupure / GlideWebpDecoder

A Glide WebpDecoder Intergration Library for decoding and displaying webp images
Apache License 2.0
747 stars 91 forks source link

为什么要默认循环播放,是出于什么考虑? #103

Closed liujingxing closed 1 year ago

liujingxing commented 1 year ago

我看WebpDrawable构造方法是可以拿到Webp图片自身的loopCount,当这个loopCount大于0时,赋值给maxLoopCount是否更为合理,如下:

WebpDrawable(WebpState state) {
    this.isVisible = true;
    int intrinsicCount = state.frameLoader.getLoopCount();
    this.maxLoopCount = intrinsicCount > 0 ? intrinsicCount : LOOP_FOREVER;
    this.state = Preconditions.checkNotNull(state);
}

现在我想仅播放一次的话,还是略微有点麻烦,我大部分场景webp自身的loopCount都等于1

zjupure commented 1 year ago

跟GifDrawable行为对齐的,大部分webp都没有设置loopCount

liujingxing commented 1 year ago

感觉很不合理,如果是这样的话,webp自带的loopCount就没有多大的意义; 顺便说下,Fresco就是优先取webp自带的loopCount,如果可以的话,还是希望支持下。

zjupure commented 1 year ago

如果fresco用的webp自带的loopCount,可以优化对齐,可以提个修复MR