dhyanb / open-imaging Goto Github PK
View Code? Open in Web Editor NEWTools and libraries that deal with the creation and processing of images.
License: Apache License 2.0
Tools and libraries that deal with the creation and processing of images.
License: Apache License 2.0
It looks like some gifs are being decoded incorrectly.
For example this gif from giphy - https://media.giphy.com/media/26DN81TqLPIzBlksw/giphy.gif
I got broken frames starting from 11-th frame:
Can you please take a look?
While debugging some gifs that even Paint Shop Pro fails to render (but Windows, Firefox and Microsoft GIF Animator do read correctly) I found all of them had no clear code as the first code in each frame.
Removing line 202 fixed it.
bits.read(); // Skip leading clear code
However this breaks all other GIFs because now their clear code is interpreted as a color code. Need to investigate.
GifImage.getFrame(int) returns an internal representation of the animation.
This has two consequences:
This behavior is undocumented, and lead to a bug in my application, where I saw an animation of only the last frame.
Fortunately the API doesn't have to change in order to fix this, keeping backwards compatibility.
public BufferedImage getFrame(int index) {
if (img == null || index < prevIndex) { // (Re)Init
img = new BufferedImage(width, height, 2); // 2 = ARGB
prevImg = new BufferedImage(width, height, 2);
prevIndex = -1;
prevDisposal = 2;
}
// Draw current frame on top of previous frames
for (int i = prevIndex + 1; i <= index; i++) {
GifFrame fr = frames.get(i);
drawFrame(fr);
prevIndex = i;
prevDisposal = fr.disposalMethod;
}
BufferedImage copy = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics g = copy.createGraphics();
try {
g.drawImage(img, 0, 0, null);
} finally {
g.dispose();
}
return copy;
}
hi,jdk8 support? I see readme only support jdk1.7
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.