Git Product home page Git Product logo

Comments (7)

zjupure avatar zjupure commented on May 26, 2024

看了下libwebp库底层是支持RGB_565解码的,需要把config信息传递下去,这个要求webp动画中不含有透明的帧,目前没有实现

from glidewebpdecoder.

MerlinYu avatar MerlinYu commented on May 26, 2024

我看了源码,从上层不支持config信息传递,我们的项目大量使用到webp的动态,想优化一下这化图片的内存占用 @zjupure

from glidewebpdecoder.

zjupure avatar zjupure commented on May 26, 2024

https://github.com/zjupure/GlideWebpDecoder/blob/master/webp_decoder/src/main/jni/webp.cpp#L482
@MerlinYu native层核心decode代码在WebPFrame_nativeRenderFrame()里,传递的Bitmap里有config信息,可以从这里读到解码的格式,然后配置webp的decode参数,解码/渲染等地方需要修改,感兴趣可以先尝试修改下

from glidewebpdecoder.

zjupure avatar zjupure commented on May 26, 2024

本地修改试了下,webp动画两个关键帧之间几乎都是带alpha通道的,使用RGB_565解码会丢失信息,导致渲染画面时失真。

from glidewebpdecoder.

ksc91u avatar ksc91u commented on May 26, 2024

請問一下這個問題有解嗎?
剛剛測試了最新版的還是沒有透明度

使用範例的這個檔案
https://qidian.qpic.cn/qidian_common/349573/a36f7d7d8a5e15e1cf3c32d05109467a/0

謝謝

from glidewebpdecoder.

zjupure avatar zjupure commented on May 26, 2024

@ksc91u 这个有什么问题,可以正常渲染,背景就是透明的,你可以修改ImageView的背景色验证

from glidewebpdecoder.

ksc91u avatar ksc91u commented on May 26, 2024

不好意思是我犯傻了, 的確看到的是 ImageView 的背景色, 改成透明就好了, 感謝大大

另外發現, 在我的 app 裡面是因為加上了

.setDefaultTransitionOptions( Bitmap::class.java, BitmapTransitionOptions.withCrossFade(200) )

.setDefaultTransitionOptions( Drawable::class.java, DrawableTransitionOptions.withCrossFade(200) )

在加載一般圖片的時候有特效, 才導致 webp 動畫變成有背景的。

from glidewebpdecoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.