< 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;
*** 2587,2596 ****
--- 2591,2604 ----
nextSpace = pos + byteCount;
}
pixelsDone += tileRect.width*tileRect.height;
processImageProgress(100.0F*pixelsDone/totalPixels);
+ if (abortRequested()) {
+ processWriteAborted();
+ return;
+ }
// Fill in the offset and byte count for the file
stream.mark();
stream.seek(stripOrTileOffsetsPosition);
stream.writeInt((int)pos);
*** 2601,2615 ****
stripOrTileByteCountsPosition += 4;
stream.reset();
} catch (IOException e) {
throw new IIOException("I/O error writing TIFF file!", e);
}
-
- if (abortRequested()) {
- processWriteAborted();
- return;
- }
}
}
processImageComplete();
currentImage++;
--- 2609,2618 ----
*** 2818,2840 ****
// Seek to the next available space.
stream.seek(nextSpace);
// Write the image (IFD and data).
write(null, image, param, false, writeData);
!
// Seek to the position containing the pointer in the new IFD.
stream.seek(nextIFDPointerPos);
// Update the new IFD to point to the old IFD.
stream.writeInt((int)ifd[0]);
// Don't need to update nextSpace here as already done in write().
-
- if (abortRequested()) {
- stream.seek(ifdpos[0]);
- stream.writeInt((int)prevPointerValue);
- resetPositions();
- }
}
// ----- BEGIN insert/writeEmpty methods -----
private boolean isEncodingEmpty() {
--- 2821,2841 ----
// Seek to the next available space.
stream.seek(nextSpace);
// Write the image (IFD and data).
write(null, image, param, false, writeData);
! if (abortRequested()) {
! stream.seek(ifdpos[0]);
! stream.writeInt((int)prevPointerValue);
! resetPositions();
! }
// Seek to the position containing the pointer in the new IFD.
stream.seek(nextIFDPointerPos);
// Update the new IFD to point to the old IFD.
stream.writeInt((int)ifd[0]);
// Don't need to update nextSpace here as already done in write().
}
// ----- BEGIN insert/writeEmpty methods -----
private boolean isEncodingEmpty() {
< prev index next >