-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Hello 😇
I've found an issue on my working project. I have faced with a problem when some of our GIF display incorrectly.
I've investigated and found out that:
- SampleSize doesn't work if the value grater then 1 was passed
(But as I see, you are already know it and even managed to fix 👍 Waiting for the release) - GIF is decoded as 1 frame animation.
Let's talk about second one.
Our GifDrawable
creating has next steps:
GifOptions gifOptions = new GifOptions();
gifOptions.setInSampleSize(gifInSampleSize); // 'gifInSampleSize' was calculated before
drawable = new GifDrawableBuilder()
.from(mContext.getContentResolver(), gifUri)
.options(gifOptions)
.build();
drawable.setLoopCount(0);
As the result GifDrawable
is: GIF: size: 1999x1999, frames: 1, error: 107
Here we can see 107 error and only 1 fetched frame (but actually it has more frames 😞)
About GIF. Nothing special here except of "why is it so big??? 🙃".
Yes, it is really big. And, btw, gifInSampleSize = 4
here 🤫
It was found during the testing of different sizes.
How was this GIF born:
- usual GIF was downloaded from site
- gif size was changed via online converter.
I request you help in case of at least explanation "why it was decoded as 1 frame". I don't know, probably, online converter made it's own dirty monkey tricks and GIF file become broken. So, I would appreciate any of your help and explanation here.
P.S. I have tested this gif with your sample project and added this 'broken' GIF to drawable
resources. Result is the same. You can reproduce it by yourself, I'll attach it.
P.P.S. GIF playing is okey for my PC (more than 1 frame animation)