-
-
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
Can't open on Android studio ? #342
Comments
It seems that something is wrong with your gradle. |
I've now tested the project at home. |
Here is a sample application project: https://github.com/koral--/android-gif-drawable-sample |
@koral-- OK, thank you. I think you should merge the 2 projects. Usually library comes with a sample to try...
|
There is a link to sample project in readme: https://github.com/koral--/android-gif-drawable#usage and nobody has reported such issue so far but I'll consider merging repos.
|
I don't understand. Why can't it just use the library via gradle, and just work ? Why do I have to clone another project? |
Library is a git submodule of sample project. You can clone them all in one shot using |
Alternatively if just want to play with sample, you can switch dependencies in https://github.com/koral--/android-gif-drawable-sample/blob/master/sample/build.gradle#L51, comment out line 51. and uncomment 52. Library from maven repository will be used instead of local submodule. |
Reopened until merged project is ready. |
OK, sample is now in the same repo as library, available in dev branch https://github.com/koral--/android-gif-drawable/tree/dev |
@koral-- How do I clone a branch? Cloning using the "clone or download" button uses the normal one... |
When cloning using tortoisegit tool, I entered "dev" as the branch (because that's the recent I've found). |
The only common restriction is minimum API level 9. Some features require API 14 and hardware accelerated canvas or OpenGL ES 2. There is no known hardware issues. Memory usage is proportional to the GIF canvas size but not to the number of frames. Frames are not buffered in general. |
So the only memory in Heap that it uses, is of the current frame-bitmap to show? |
Apart from metadata (like frame durations, global color table etc.) there are 3 main buffers stored on heap:
|
So... can you give an example of how much memory it will use on heap? |
Assume the following GIF:
So you get 100 * 100 * 4 bytes from p. 1. and 20*20 bytes from p 2. and 0 bytes from p. 3. Those buffers are only disposed at the end of lifetime. During animation they are reused for subsequent frames. |
shouldn't it be just the canvas size ? meaning 100_100_4 ? I mean, the Bitmap object that Java needs is in this size alone... what would it do with the others? or maybe by canvas you mean the one of the view? |
ad 1. I mean GIF canvas, in most cases its size is equal to size in logical screen descriptor in the GIF header. It is the entire space which can be used for drawing. It is backed by Bitmap, OpenGL texture etc. It cannot be reduced to size of the largest frame because previous contents of the drawing surface is not preserved between subsequent frames. That means you need to draw entire GIF canvas in ad 2. Raster works as lookup table. It stores color indexes from color table for each pixel of the frame. It cannot be located at the same place as pixels (RGBA values) because both data are needed at the same time. ad 3. it is theoretically possible to get rid of this buffer by decoding again relevant part of previous frame however in some cases it will require decoding all the frames from the beginning so it may consume a lot of time. |
I see. |
There is method with that name (based on Even if input source is mutable (eg. file) and is modified during animation it won't change possible maximum because metadata (including disposal methods) is only read at loading time. Just added issue to track that featue: https://github.com/koral--/android-gif-drawable/issues/348 BTW when checking this I noticed a mismatch in linked javadoc, I'll fix it as well. |
I don't understand. Can you please consider adding this function to check how much (heap) memory would a gif file take ? |
Yes, I said that I'll try to add that function. Progress can be tracked in issue #348. |
OK. Say, does WebP also support animation? On Sun, Sep 25, 2016 at 10:59 PM, Karol Wrótniak [email protected]
|
Yes, WebP can be animated.
There is no plan to lower minimum API level. |
"Older Android versions was supported in the past" On Mon, Sep 26, 2016 at 1:10 AM, Karol Wrótniak [email protected]
|
I don't understand. Are you asking starting from which version Android supports WebP natively? |
Webp animation . Not just image. The docs don't talk about it. Also I On Sep 26, 2016 02:21, "Karol Wrótniak" [email protected] wrote:
|
Creation should be possible using gif2webp, webpmux and libwebp api |
Nice. |
I don't know either from which API does Android support animated WebP. Indeed there is no such information in docs. Interesting tool. I also see your tickets on android issue tracker. I'm curious if Google adds WebP converter or support for WebP 9-patches. |
The 9-patches WebP isn't supported on any API, as far as I know. |
I've recently searched for WebP related issues and remembered your email. |
But I never wrote my email here. Anyway, thank you for all the help. |
In README of WebpifyYourAndroidApp there is a link to issue tracker with the same reporter email. |
Oh... Right you are On Sep 27, 2016 02:07, "Karol Wrótniak" [email protected] wrote:
|
@AndroidDeveloperLB It is available in |
Nice. Thank you. |
Currently it only works for already created |
Nice! |
Just added
|
What's the bitmap parameter? It already belongs to a gif file... |
There should be Sample size is related to GifOptions#setInSampleSize. This is equivalent of BitmapFactory.Options#inSampleSize. |
Nice! |
This is what I get:
The text was updated successfully, but these errors were encountered: