Open Imaging - Development of a free GIF decoder

I finished development of my very own GIF image decoder. It’s freely available on GitHub (see github.com/DhyanB/Open-Imaging) and licensed under the Apache License, Version 2.0.

During the development the following resources have been very helpful to me:

Normally the specification and one or two good articles should be sufficient to get started, but there are several ambiguities in the specification that lead to inconsistent understanding and implementation of the standard. Therefore it’s important to look at the problem from a couple of different perspectives. Examples of problematic topics include: background drawing, handling clear codes and implementing disposal methods.

One of the most widley used GIF decoder written in Java is the one from Kevin Weiner (2003). However, like most Java decoders I came across, it has a bug that causes ArrayIndexOutOfBounds exceptions to be thrown for a certain number of GIF images. Here is a description of the bug. As you can see, this bug affects the famous ImageIO.read() method that comes with Java itself as well as the Apache Commons imaging library. As far as I know, the only Java library not suffering from this bug is GIF4J. It is, however, quite expensive and closed source.

/images/moon-landing.gif