-
-
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
Need to be able to get size in bytes from GifDrawables #29
Comments
I've added getNumBytes() method in 909ec38 |
I think being able to get the total memory foot print for the backing GIF data is more important than getting the frame size. At least for dealing with cache sizes. However I actually think there is a larger problem to solve here. So I've created a new bug: #30 |
So how should we exactly count total memory foot print ? Just number of bytes in input source (affected by compression)? |
Well we could have the method be smart enough to determine the actual in-memory footprint depending on the input source, and the GIF it's self (store to previous). Or we could just name it specifically enough to be clear it is giving you the compressed, backing data. My use case would be served by either solution. However I could see a simpler solution potentially being more useful. Have a method that specifically gets the size of the backing data. And another method that gets you the size of the frames it's storing. |
OK, so to sum up, we need the following changes:
|
Ya that looks like it'd solve all the possible use cases I can foresee! |
#getAllocationByteCount() added in 5e05c14 |
#getInputSourceByteCount() added in d4a2a81 |
I don't think this should be particularly difficult, but with other drawables, like Bitmaps, we can determine their size in bytes, which is very useful for caching strategies. But with GifDrawable, once we create one, we have no way of querying it for it's size in bytes.
Just a method like: getNumBytes() or what ever would be very useful!
The text was updated successfully, but these errors were encountered: