Skip to main content

java.lang.ArithmeticException: / by zero {in TIFFImageDecoder}

1 reply [Last post]
styriver
Offline
Joined: 2005-05-23

Hello in our document imaging project on occasion we get the following exception thrown when attempting to index an incoming fax document. It is being thrown at line 112 of TIFFImageDecoder. Has anyone seen this issue before. I have inclued the code snippet and the stack trace from our logs.

static public HashMap indexTif (
byte [] aContent
)
{
SeekableStream mySeekableStream = null
ImageDecoder myImageDecoder = null;

mySeekableStream = new ByteArraySeekableStream(aContent);
myImageDecoder = ImageCodec.createImageDecoder("tiff", mySeekableStream, null);

int myPageCount = myImageDecoder.getNumPages();
for (int i = 0; i < myPageCount; ++i)
{
// Create the image for a given page.
RenderedImage myRenderedImage = myImageDecoder.decodeAsRenderedImage(i);
Raster myRaster = myRenderedImage.getData();
}

| 42| |05:01:25.097 CDT|IndexHelper | 269|IndexHelper |indexTif | |T-0 |main | | |INFO |ERROR |[Caught] java.lang.ArithmeticException: / by zero
| 42| |05:01:25.097 CDT|TIFFImage | 646|TIFFImage | | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
| 42| |05:01:25.097 CDT|TIFFImageDecoder| 112|TIFFImageDecoder |decodeAsRenderedImage | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
| 42| |05:01:25.097 CDT|IndexHelper | 98|IndexHelper |indexTif | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
| 42| |05:01:25.097 CDT|ImagingI.terImpl| 153|ImagingIndex.AdapterImpl|processInternal | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
| 42| |05:01:25.097 CDT|Endpoint.terImpl| 329|EndpointSite.AdapterImpl|process | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
| 42| |05:01:25.097 CDT|InboundE.Manager|1079|InboundEndpointManager |constructAnd.pointMessage| |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
| 42| |05:01:25.097 CDT|InboundE.Manager| 661|InboundEndpointManager |handleInputMessage | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
| 42| |05:01:25.097 CDT|Transpor.rThread| 208|TransportRel.orkerThread|doProcessing | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
| 42| |05:01:25.097 CDT|EMagicWo.rThread| 725|EMagicWorkerThread |runner | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
| 42| |05:01:25.097 CDT|EMagicThread | 307|EMagicThread |run | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
| 42| |05:01:25.097 CDT|Thread | 536|Thread |run | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Aastha Bhardwaj

Hi Scott,

Could you provide a self-contained compiling test case along with an
image that is causing this Exception, so that we can investigate further?

Thanks,

Aastha

---------------------
Aastha Bhardwaj
Java Advanced Imaging
Sun Microsystems

> Hello in our document imaging project on occasion we get the following exception thrown when attempting to index an incoming fax document. It is being thrown at line 112 of TIFFImageDecoder. Has anyone seen this issue before. I have inclued the code snippet and the stack trace from our logs.
>
> static public HashMap indexTif (
> byte [] aContent
> )
> {
> SeekableStream mySeekableStream = null
> ImageDecoder myImageDecoder = null;
>
>
> mySeekableStream = new ByteArraySeekableStream(aContent);
> myImageDecoder = ImageCodec.createImageDecoder("tiff", mySeekableStream, null);
>
> int myPageCount = myImageDecoder.getNumPages();
> for (int i = 0; i < myPageCount; ++i)
> {
> // Create the image for a given page.
> RenderedImage myRenderedImage = myImageDecoder.decodeAsRenderedImage(i);
> Raster myRaster = myRenderedImage.getData();
> }
>
>
> | 42| |05:01:25.097 CDT|IndexHelper | 269|IndexHelper |indexTif | |T-0 |main | | |INFO |ERROR |[Caught] java.lang.ArithmeticException: / by zero
> | 42| |05:01:25.097 CDT|TIFFImage | 646|TIFFImage | | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> | 42| |05:01:25.097 CDT|TIFFImageDecoder| 112|TIFFImageDecoder |decodeAsRenderedImage | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> | 42| |05:01:25.097 CDT|IndexHelper | 98|IndexHelper |indexTif | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> | 42| |05:01:25.097 CDT|ImagingI.terImpl| 153|ImagingIndex.AdapterImpl|processInternal | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> | 42| |05:01:25.097 CDT|Endpoint.terImpl| 329|EndpointSite.AdapterImpl|process | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> | 42| |05:01:25.097 CDT|InboundE.Manager|1079|InboundEndpointManager |constructAnd.pointMessage| |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> | 42| |05:01:25.097 CDT|InboundE.Manager| 661|InboundEndpointManager |handleInputMessage | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> | 42| |05:01:25.097 CDT|Transpor.rThread| 208|TransportRel.orkerThread|doProcessing | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> | 42| |05:01:25.097 CDT|EMagicWo.rThread| 725|EMagicWorkerThread |runner | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> | 42| |05:01:25.097 CDT|EMagicThread | 307|EMagicThread |run | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> | 42| |05:01:25.097 CDT|Thread | 536|Thread |run | |T-0 |main | | |INFO |ERROR | <<< Stack TRACE >>>
> ---
> [Message sent by forum member 'styriver' (Scott)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=83644&#83644
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net