1

i want to create a multi-page-TIFF with one or two pages. The problem is: if I use the ImageWriteParam to set any kind of compression the 2nd page in the TIFF goes completely black. If i don't set a compression it is displayed fine (the file is really big though)

Here is a snipped of what I am doing:

ImageWriter writer = tiffspi.createWriterInstance();
writer.setOutput(ios);

ImageWriteParam param = writer.getDefaultWriteParam();
// TODO fix compression - 2nd page is always black!
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
param.setCompressionType("JPEG");
param.setCompressionQuality(1f);

writer.prepareWriteSequence(null);
writer.writeToSequence(new IIOImage(frontImage, null, null), param);
if (backImage != null) {
  writer.writeToSequence(new IIOImage(backImage, null, null), param);
}
writer.endWriteSequence();
writer.dispose();

Any ideas?

mortalis
  • 2,060
  • 24
  • 34
Mario B
  • 2,102
  • 2
  • 29
  • 41
  • I think you are, unfortunately, running into [this bug](https://github.com/haraldk/TwelveMonkeys/issues/334). The fix is pretty simple, but I haven't been able to make a new release yet. Hope to be able to provide it soon! – Harald K Jul 04 '17 at 07:37
  • Thanks for your response! Is there a possible workaround or something? – Mario B Jul 05 '17 at 13:09
  • The bug is now fixed in master. A release should follow soon. – Harald K Aug 28 '17 at 07:21

0 Answers0