Convert TIFF to CCITT4 format

Hi,
Is it possible to convert an uncompressed (or compressed lossless PackBits RLE) TIFF into a TIFF compressed using CCITT4 Compression? We tried the following code:

TiffImage image = new TiffImage(new StreamContainer(new ByteArrayInputStream(uncompressedTiff)));
TiffOptions to = new TiffOptions();
to.setCompression(CompressionType.CCITT4);
ByteArrayOutputStream compressedTiff = new ByteArrayOutputStream();
image.save(compressedTiff, to);

But this throws an error:

com.aspose.imaging.exceptions.imageformats.TiffImageException: There is no active frame selected.
at com.aspose.imaging.fileformats.tiff.TiffImage.getActiveFrame(Unknown Source)
at com.aspose.imaging.fileformats.tiff.TiffImage.getWidth(Unknown Source)
at com.aspose.imaging.hidden.c.l.a(Unknown Source)
at com.aspose.imaging.Image.saveInternal(Unknown Source)
at com.aspose.imaging.Image.save(Unknown Source)
at com.wellsfargo.wts.wsts.ims.ccg.handlers.AsposePDFManipulationHandler.ConvertPDFToTIFF(AsposePDFManipulationHandler.java:248)
at com.wellsfargo.wts.wsts.ims.ccg.handlers.ConversionDelegator.convertToSingleDocument(ConversionDelegator.java:109)
at com.wellsfargo.wts.wsts.ims.ccg.handlers.ConversionDelegator.convertContent(ConversionDelegator.java:34)
at com.wellsfargo.wts.wsts.ims.ccg.core.CCGLibWrapper.convertContent(CCGLibWrapper.java:28)
at Snippet.convertContentMenu(Snippet.java:86)
at Snippet.main(Snippet.java:52)
java.lang.Exception: An unexpected error has occured.
at com.wellsfargo.wts.wsts.ims.ccg.core.CCGLibWrapper.convertContent(CCGLibWrapper.java:34)
at Snippet.convertContentMenu(Snippet.java:86)
at Snippet.main(Snippet.java:52)
Caused by: com.aspose.imaging.exceptions.ImageSaveException: Image export failed.
at com.aspose.imaging.Image.saveInternal(Unknown Source)
at com.aspose.imaging.Image.save(Unknown Source)
at com.wellsfargo.wts.wsts.ims.ccg.handlers.AsposePDFManipulationHandler.ConvertPDFToTIFF(AsposePDFManipulationHandler.java:248)
at com.wellsfargo.wts.wsts.ims.ccg.handlers.ConversionDelegator.convertToSingleDocument(ConversionDelegator.java:109)
at com.wellsfargo.wts.wsts.ims.ccg.handlers.ConversionDelegator.convertContent(ConversionDelegator.java:34)
at com.wellsfargo.wts.wsts.ims.ccg.core.CCGLibWrapper.convertContent(CCGLibWrapper.java:28)
… 2 more
Caused by: com.aspose.imaging.exceptions.imageformats.TiffImageException: There is no active frame selected.
at com.aspose.imaging.fileformats.tiff.TiffImage.getActiveFrame(Unknown Source)
at com.aspose.imaging.fileformats.tiff.TiffImage.getWidth(Unknown Source)
at com.aspose.imaging.hidden.c.l.a(Unknown Source)
… 8 more


I’m attaching the original TIFF that we are trying to convert.

Thanks.

Hi David,


Thanks for your inquiry. We are in process of testing and publishing new release of Aspose.Imaging for Java. We will test the scenario with new release and will share the results with you soon.

Best Regards,

Hi David,


We are sorry for the delayed response. I’m afraid currently CCITT4 compression type is not supported. However, I’ve logged a ticket as IMAGING-33619 for further investigation and resolution. We will keep you updated about the issue progress via this forum thread.

We are sorry for the inconvenience.

Best Regards,

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.