Skip to main content

Getting an Error 5 on certain tiff files

1 reply [Last post]
Anonymous

We use the docstar system, and I've been printing the tiff files from java. But after implementing a system that prints hundreds of these document tiff files, java started crashing on certain files, and in the log was this message, using JAI 1.1.2:

java.lang.Error: Invalid code encountered while decoding 2D group 4 compressed d
ata.
at com.sun.media.jai.codecimpl.TIFFFaxDecoder.decodeT6(TIFFFaxDecoder.ja
va:1093)
at com.sun.media.jai.codecimpl.TIFFImage.getTile(TIFFImage.java:1067)
at com.sun.media.jai.codecimpl.SimpleRenderedImage.getData(SimpleRendere
dImage.java:462)
at sun.java2d.SunGraphics2D.drawRenderedImage(SunGraphics2D.java:2323)
at sun.print.PSPathGraphics.drawRenderedImage(PSPathGraphics.java:612)
at ctaa.paintTiff.print(paintTiff.java:34)
at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1638)
at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1210)
at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1111)
at sun.reflect.GeneratedMethodAccessor599.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)

In JAI 1.1.3 beta I got a similar error, tho it didn't crash the JVM.

With imageIO I get this:

java.lang.Error: (Error 5) thrown from javax.imageio.ImageIO.read())

The document files look fine from windows image viewer or Docstar.

Any ideas?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bpb
Offline
Joined: 2004-06-23

> java.lang.Error: Invalid code encountered while
> decoding 2D group 4 compressed d
> ata.
> at
> at
> at
> at
> com.sun.media.jai.codecimpl.TIFFFaxDecoder.decodeT6(TI
> FFFaxDecoder.ja
> va:1093)

The above problem occurs because the file does not conform to the ITU/CCITT T.6 (group 4 fax) standard.

> In JAI 1.1.3 beta I got a similar error, tho it
> didn't crash the JVM.

The Error does not "crash the VM". In JAI 1.1.3-beta however the Errors are replaced by Exceptions from which you should be able to recover by registering an ImagingListener and dealing with the Exception therein.

> With imageIO I get this:
>
> java.lang.Error: (Error 5) thrown from
> javax.imageio.ImageIO.read())

The Error->Exception conversion has yet to be done for Image I/O.

> The document files look fine from windows image
> viewer or Docstar.

They have apparently introduced a workaround for the erroneous files that we do not have.

You might want to file an issue in either the jai-core.dev.java.net or jai-imageio-core.dev.java.net projects or both as appropriate.

Brian