src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java

Print this page

        

*** 106,115 **** --- 106,116 ---- private static final int VERSION_5_XP_EMBEDDED = 18; // BMP variables private long bitmapFileSize; private long bitmapOffset; + private long bitmapStart; private long compression; private long imageSize; private byte palette[]; private int imageType; private int numBands;
*** 675,684 **** --- 676,687 ---- // Reset to the start of bitmap; then jump to the //start of image data iis.reset(); iis.skipBytes(bitmapOffset); + bitmapStart = iis.getStreamPosition(); + gotHeader = true; } public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IOException {
*** 811,820 **** --- 814,825 ---- sdata = ((DataBufferUShort)raster.getDataBuffer()).getData(); else if (sampleModel.getDataType() == DataBuffer.TYPE_INT) idata = ((DataBufferInt)raster.getDataBuffer()).getData(); } + iis.seek(bitmapStart); + // There should only be one tile. switch(imageType) { case VERSION_2_1_BIT: // no compression