reading JP2 one band at a time gives corrupted image in some cases
I have a number of test jp2 images, all 24 bit (i.e. 8 bits per pixel, 3 bands) RGB, from which I have been able to correctly read and retrieve one band at a time.
However, applying this same code to a certain other image, also 24 bit RGB, returns a portion of the desired band as just a gray area (all or most of the pixels in this area are corrupted to value -128).
When I try reading two bands at once from this image, there is no such corruption!
int srcBands = new int;
srcBands = 0; //any of 0, 1, or 2 will reproduce it
Rectangle srcReg = new Rectangle(256,0,256,256); //I am extracting 256x256 windows from the image at a time. This particular window includes the corruption.
J2KImageReadParam jirp = new J2KImageReadParam();
RenderedImage decompIm = imread.readAsRenderedImage(0, jirp);
I can provide the image over email as needed.