#401 #334 Work around for stream position issue in FileCacheImageOutputStream causing garbled output for multipage TIFF files

+ Added regression tests.
This commit is contained in:
Harald Kuhr
2017-12-22 22:01:10 +01:00
parent 921dba89f7
commit 63830a26e5
2 changed files with 101 additions and 15 deletions
@@ -947,9 +947,9 @@ public final class TIFFImageWriter extends ImageWriterBase {
throw new IllegalStateException("prepareWriteSequence() must be called before writeToSequence()!");
}
if (sequenceLastIFDPos > 0) {
imageOutput.seek(imageOutput.length());
if (sequenceIndex > 0) {
imageOutput.flushBefore(sequenceLastIFDPos);
imageOutput.seek(imageOutput.length());
}
sequenceLastIFDPos = writePage(sequenceIndex++, image, param, sequenceTIFFWriter, sequenceLastIFDPos);