My Oracle Support Banner

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.

Symptoms


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.

Example:

Exception in thread "main" javax.imageio.IIOException: Unexpected block type 0!
at com.sun.imageio.plugins.gif.GIFImageReader.readMetadata(GIFImageReader.java:722)
at com.sun.imageio.plugins.gif.GIFImageReader.read(GIFImageReader.java:794)
at javax.imageio.ImageReader.readAll(ImageReader.java:1050)
at MetadataViewer.main(MetadataViewer.java:82)



Changes

You have deployed a new release with new images.

Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Changes
Cause
Solution

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.