Comments (7)
看了下libwebp库底层是支持RGB_565解码的,需要把config信息传递下去,这个要求webp动画中不含有透明的帧,目前没有实现
from glidewebpdecoder.
我看了源码,从上层不支持config信息传递,我们的项目大量使用到webp的动态,想优化一下这化图片的内存占用 @zjupure
from glidewebpdecoder.
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.
本地修改试了下,webp动画两个关键帧之间几乎都是带alpha通道的,使用RGB_565解码会丢失信息,导致渲染画面时失真。
from glidewebpdecoder.
請問一下這個問題有解嗎?
剛剛測試了最新版的還是沒有透明度
使用範例的這個檔案
https://qidian.qpic.cn/qidian_common/349573/a36f7d7d8a5e15e1cf3c32d05109467a/0
謝謝
from glidewebpdecoder.
@ksc91u 这个有什么问题,可以正常渲染,背景就是透明的,你可以修改ImageView的背景色验证
from glidewebpdecoder.
不好意思是我犯傻了, 的確看到的是 ImageView 的背景色, 改成透明就好了, 感謝大大
另外發現, 在我的 app 裡面是因為加上了
.setDefaultTransitionOptions( Bitmap::class.java, BitmapTransitionOptions.withCrossFade(200) )
.setDefaultTransitionOptions( Drawable::class.java, DrawableTransitionOptions.withCrossFade(200) )
在加載一般圖片的時候有特效, 才導致 webp 動畫變成有背景的。
from glidewebpdecoder.
Related Issues (20)
- java.lang.IndexOutOfBoundsException
- Support for Glide 4.14.2 HOT 2
- NullPointerException in WebpFrameLoader#onFrameReady HOT 1
- 为什么要默认循环播放,是出于什么考虑? HOT 3
- 加载动图和加载静态图片能合并吗? HOT 2
- Support for KSP HOT 9
- 希望公开OnEveryFrameListener接口及其set方法 HOT 1
- 加载webp动图,结果图片缩小了 HOT 1
- 使用协程好像会出现多线程问题 HOT 1
- 首帧预览 功能 HOT 2
- 在 onResourceReady call WebpDrawable#stop() 沒有辦法停下動畫 HOT 1
- ImageView宽高为wrap_content时webp动图问题 HOT 3
- How to use in SpannableString with ImageSpan ? HOT 6
- Request: update Glide version HOT 2
- Can't use repository for some reason HOT 5
- 配合共享元素转场动画掉帧卡顿
- Needs to support 4.13.2 HOT 4
- WebpDecoder 多线程问题 HOT 1
- Why not consider adding a method to stop at what frame? HOT 2
- 加载Duration小于20毫秒的webp图片动得很慢 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glidewebpdecoder.