S
surendra
Hi,
I am trying to convert TIFF Image to JPEG. For some of the images I
get the following exception.
My first thought was may be the image is not correct. I can view
the Tiff image ok and I can convert to PNG as well.
Please post here if you have any info on this exception.
Regards,
Suren
EXCEPTION DETAILS:
java.lang.ArrayIndexOutOfBoundsException: 44544
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:941)
at javax.media.jai.OpImage.getTile(OpImage.java:1139)
at javax.media.jai.PlanarImage.getData(PlanarImage.java:2220)
at javax.media.jai.PlanarImage.getData(PlanarImage.java:2029)
at javax.media.jai.RenderedOp.getData(RenderedOp.java:2277)
at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:180)
SOURCE CODE:
try{
RenderedOp source = JAI.create("fileload", filename);
FileOutputStream stream = null;
stream = new FileOutputStream(jpegFileName );
com.sun.media.jai.codec.JPEGEncodeParam JPEGparam = new
com.sun.media.jai.codec.JPEGEncodeParam();
ImageEncoder encoder =
ImageCodec.createImageEncoder("jpeg",stream,JPEGparam);
encoder.encode(source);
}catch(Exception e){
e.printStackTrace();
}
I am trying to convert TIFF Image to JPEG. For some of the images I
get the following exception.
My first thought was may be the image is not correct. I can view
the Tiff image ok and I can convert to PNG as well.
Please post here if you have any info on this exception.
Regards,
Suren
EXCEPTION DETAILS:
java.lang.ArrayIndexOutOfBoundsException: 44544
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:941)
at javax.media.jai.OpImage.getTile(OpImage.java:1139)
at javax.media.jai.PlanarImage.getData(PlanarImage.java:2220)
at javax.media.jai.PlanarImage.getData(PlanarImage.java:2029)
at javax.media.jai.RenderedOp.getData(RenderedOp.java:2277)
at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:180)
SOURCE CODE:
try{
RenderedOp source = JAI.create("fileload", filename);
FileOutputStream stream = null;
stream = new FileOutputStream(jpegFileName );
com.sun.media.jai.codec.JPEGEncodeParam JPEGparam = new
com.sun.media.jai.codec.JPEGEncodeParam();
ImageEncoder encoder =
ImageCodec.createImageEncoder("jpeg",stream,JPEGparam);
encoder.encode(source);
}catch(Exception e){
e.printStackTrace();
}