Have tried with other images, and jpgs works correctly. This image:
http://home.halden.net/tombr/misc/grass.gif causes a:
java.lang.ArrayIndexOutOfBoundsException: 4096
at com.sun.imageio.plugins.gif.GIFImageReader.read(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
at ImageLoader.loadImage(ImageLoader.java:51)
at jsgcApplet.loadimages(jsgcApplet.java:136)
at jsgcApplet.init(jsgcApplet.java:51)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
It is also influenced by the browser cache. I've done the following:
1. Compile and jar with the working workaround (loading data before sending it to ImageIO)
2. Open applet in Internet explorer. The image shows correctly.
3. Change source code to use the bugged imageloader. Compile and jar it.
4. Reload internet explorer using ctrl+reload. The image shows correcly.
5. Close all instances of internet exploerer
6. Opening the same applet again. The image is bugged.