nemosupremo / gifdrawable-android Goto Github PK
View Code? Open in Web Editor NEWJava class for rendering and animating gif files on Android that extends Bitmap Drawable that makes use of the Android NDK.
License: MIT License
Java class for rendering and animating gif files on Android that extends Bitmap Drawable that makes use of the Android NDK.
License: MIT License
Thanks for that have done a good job. However, using the code from the example as is visible rendering artifacts when playing a GIF. Like as:
http://www.youtube.com/watch?v=DjKI9b8jBMw&feature=youtu.be.
I would be grateful if you shared their ideas about the cause and how to fix it.
I try to play this gif:
https://www.dropbox.com/s/xjzrhrtfnx0712x/2013-05-08%2011.23.06.gif
Loading two gifs from the asset directory will cause undefined behavior.
Fix:
libgifdrawable.c @ c58e2ec
Line 45:
typedef struct GifAnimInfo {
int duration;
int current_frame;
+ int fd;
+ int bytesLeft;
} GifAnimInfo;
- int fd, bytesLeft;
Line 254:
static int readFunc(GifFileType* gif, GifByteType* bytes, int size)
{
+ int szRead = read(((GifAnimInfo *)gif->UserData)->fd, bytes, MIN(size, ((GifAnimInfo *)gif->UserData)->bytesLeft));
+ ((GifAnimInfo *)gif->UserData)->bytesLeft -= szRead;
return szRead;
}
Line 273:
+GifAnimInfo * gif_info = malloc(sizeof(GifAnimInfo));
+gif_info->fd = fd;
+gif_info-> bytesLeft = bytesLeft;
+GifFileType* gif = DGifOpen((void *)gif_info,&readFunc,&error);
error = DGifSlurp(gif);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.