-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add subsampling option #239
Comments
Currently there is no way reduce size of bitmaps used as frame buffers in |
Thanks for your quick response. Could you tell the way to reuse existing GifDrawable? |
Reusing existing |
You said "Sets drawable to be reused when creating new one. Currently it works only on KITKAT and newer, on older API levels call has no effect.". Older version can not use this way.
Is it right? |
Note about Kitkat in javadoc is outdated, this issue reminded me to remove it and it is not present in the latest snapshot. Drawable reusing is working in all API levels. For |
Thanks. Hope to see the next subsampling feature soon. |
One more question. I'm implementing a cache that keeps GifDrawable in memory. I wonder how much space does GifDrawable take in memory? It is much? Because I've had some other ones already. |
There is always one |
So Does your lib use "Restore to previous" disposal method? Because native memory is stilled counted in limited memory used for an Android application. I need to know to consider how much space for the GifDrawable cache. |
Not sure if I understand correctly, but try to answer. |
So the most memory space taken by an instance GifDrawable is a Bitmap (in heap memory)?The rest is the information of the Gif file? |
It is true that that most of the memory is consumed by
|
Got it. Thanks. |
your library is very helpful it is load GIF with low efficiency.is there any method does your libaray can build gif from combine bitmap? |
@manoj99 unfortunately not yet, but such option may be added in the future. |
Subsampling draft:
|
Subsampling option is now available on dev branch and on maven snapshot repository. It can be enabled using |
Thanks. Is it stable? |
Yeah, it should be. |
It look like everything is ready, including javadocs and subsampling is going to be included in v 1.1.14. |
Thanks. Wait for it is available on the master branch. |
Firstly, thanks for your library. It works well and save my life a lot
In your lib, you create a Bitmap in java heap with size based on the width and height of each frame. Foe each frame, you set the corresponding color pixel of the bitmap in native.
But If the gif size is so big (width and height of each frame are big also) and the imageview is small. I'm afraid of creating the bitmap can causes OutOfMemoryError in low-end devices.
How can I scale down the bitmap size?
I mean, I can pass the actual width, height of the ImageView, then the library can scale down the frame size base on those argument. This is similar to BitmapFactory.Options.inSampleSize.
Thanks in advance.
The text was updated successfully, but these errors were encountered: