Reading GIF using Java throws javax.imageio.IIOException: Unexpected block type 0!

(Doc ID 1308065.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Java Platform, Standard Edition - Version 1.4.2 to 6 [Release 1.4 to 6]
Information in this document applies to any platform.


Icons for your Java application are not displayed and you get one or more exceptions from the GIFImageReader.  Behavior depends on the app.  In the worst case, your app won't even start.


Exception in thread "main" javax.imageio.IIOException: Unexpected block type 0!
at com.sun.imageio.plugins.gif.GIFImageReader.readMetadata(
at javax.imageio.ImageReader.readAll(
at MetadataViewer.main(


You have deployed a new release with new images.


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms