JAI PlanarImage reading
I am going to be mad
while reading a tiff image file with one image in it, I got 2 images that one of them is like small preview of the other one with less resolution and pixel size. How can this be?
int pages ;
//Read the image file into memory based on the path defined in
//"imagefilename"
//Create a new file object and an input stream
File file = new File(imagefilename) ;
SeekableStream ss = new FileSeekableStream(file);
//Assume the image to be a TIFF image and create an
//image decoder object
ImageDecoder decoder = ImageCodec.createImageDecoder("tiff", ss, null);
//Get the number of pages in the image
pages = decoder.getNumPages();
// here it comes 2
//Create a new PlanarImage array
rimage = new PlanarImage[pages] ;
//Decode each page of the image
for(int i = 0; i < pages; i++)
{
rimage = PlanarImage.wrapRenderedImage(decoder.decodeAsRenderedImage(i)) ;
}

