Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有的GIF图片出现颜色异常 #96

Closed
candrwow opened this issue Jan 13, 2019 · 2 comments
Closed

有的GIF图片出现颜色异常 #96

candrwow opened this issue Jan 13, 2019 · 2 comments

Comments

@candrwow
Copy link

candrwow commented Jan 13, 2019

不知道是不是设置问题,我的测试图集里一共三张gif,另外两张显示完全正常,只有下面的这张异常。模拟器上pixel同样的gif知乎的matisse预览正常,但是使用本库出现色彩异常
使用的版本:

implementation 'me.panpf:sketch:2.7.0-beta1'
implementation 'me.panpf:sketch-gif:2.7.0-beta1'

使用的代码

SketchImageView imageView = new SketchImageView(context);
imageView.setZoomEnabled(true);
imageView.getZoomer().setReadMode(true);
imageView.getOptions().setDecodeGifImage(true);

在另一个地方(ViewPager的instantiateItem下)填入图片路径如下:

Media media = mediaList.get(position);
SketchImageView siv = list.get(position);
siv.displayContentImage(media.getUri().toString() + "");

2019-01-14 1 11 49

起初认为可能路径存在问题,我将gif原图放入drawable文件,在空白activity里我使用以下代码加载这张gif仍然是色彩异常

SketchImageView siv = findViewById(R.id.siv);
siv.setZoomEnabled(true);
siv.getZoomer().setReadMode(true);
siv.getOptions().setDecodeGifImage(true);
siv.displayResourceImage(R.drawable.aa);

这是gif的原图,上传后github网页不显示只有一片空白,点击空白进入gif显示,如果无法看到,明天我将gif图片发送到qq群
9d248406cf2bdae5e868c54e10ccfdde

@candrwow
Copy link
Author

我看了下这个网页,好像显示也不正常,我将原图拖入谷歌浏览器,颜色正常,但是前后有黑色,知乎的图册matisse显示完全正常无黑色,我检验过以上图片均是同一张。Glide3.7版本如下版本正常:

ImageView iv = findViewById(R.id.iv);
Glide.with(this).load(R.drawable.aa).asGif().into(iv);

@panpf
Copy link
Owner

panpf commented Jan 14, 2019

不需要什么设置,Sketch gif 方面是用的 android-gif-drawable,你可以先用 android-gif-drawable 新版本试一下,要是可以我可以升级一下

@panpf panpf closed this as completed Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants