< prev index next >

src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java

Print this page

        

*** 2435,2444 **** --- 2435,2448 ---- throw new IllegalArgumentException("Empty source region!"); } clearAbortRequest(); processImageStarted(0); + if (abortRequested()) { + processWriteAborted(); + return; + } // Optionally write the header. if (writeHeader) { // Clear previous stream metadata. this.streamMetadata = null;
*** 2585,2615 **** if(pos + byteCount > nextSpace) { nextSpace = pos + byteCount; } - pixelsDone += tileRect.width*tileRect.height; - processImageProgress(100.0F*pixelsDone/totalPixels); - // Fill in the offset and byte count for the file stream.mark(); stream.seek(stripOrTileOffsetsPosition); stream.writeInt((int)pos); stripOrTileOffsetsPosition += 4; stream.seek(stripOrTileByteCountsPosition); stream.writeInt(byteCount); stripOrTileByteCountsPosition += 4; stream.reset(); - } catch (IOException e) { - throw new IIOException("I/O error writing TIFF file!", e); - } if (abortRequested()) { processWriteAborted(); return; } } } processImageComplete(); currentImage++; --- 2589,2618 ---- if(pos + byteCount > nextSpace) { nextSpace = pos + byteCount; } // Fill in the offset and byte count for the file stream.mark(); stream.seek(stripOrTileOffsetsPosition); stream.writeInt((int)pos); stripOrTileOffsetsPosition += 4; stream.seek(stripOrTileByteCountsPosition); stream.writeInt(byteCount); stripOrTileByteCountsPosition += 4; stream.reset(); + pixelsDone += tileRect.width*tileRect.height; + processImageProgress(100.0F*pixelsDone/totalPixels); if (abortRequested()) { processWriteAborted(); return; } + } catch (IOException e) { + throw new IIOException("I/O error writing TIFF file!", e); + } } } processImageComplete(); currentImage++;
< prev index next >