[ https://issues.apache.org/jira/browse/PDFBOX-1734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13895984#comment-13895984 ]
John Hewson commented on PDFBOX-1734: ------------------------------------- Ha, TIFF certainly does feel like "The Homer", but then so does the PDF format :) I generally like the look of Apache Imaging but I'd want to know that its performance is acceptable before deciding whether or not to replace existing ImageIO code. We currently use ImageIO for reading JPEG, JPX, and JBIG2 streams. Of those formats, the JPEG plug-in is part of the JDK, the JPX plug-in is part of JAI, and the JBIG2 plug in is open source (GPL). PDFBox also includes its own reader/writer for CCITT, as well as LZW and deflate streams. Clearly, we're stuck with ImageIO for now, it's worth pointing out that ImageIOUtil is used for reading images embedded in PDFs as well as for saving rendered pages. Uh oh... I remembered that PDFBox has a CCITT Fax decoder already, so I thought I'd take a look at its code. It appears to be copied from some Sun Microsystems code but with the original copyright removed. Take a look at [this file from PDFBox|http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/TIFFFaxDecoder.java?view=markup] and [this file from image-io-ext|https://github.com/geosolutions-it/imageio-ext/blob/master/plugin/tiff/src/main/java/it/geosolutions/imageioimpl/plugins/tiff/TIFFFaxDecompressor.java]. Fortunately ImageIO is under a BSD license but it looks like we'll need to resolve this. > ImageIoUtil.WriteImage doesn't work with tiff images > ---------------------------------------------------- > > Key: PDFBOX-1734 > URL: https://issues.apache.org/jira/browse/PDFBOX-1734 > Project: PDFBox > Issue Type: Improvement > Environment: XP, W7 > Reporter: Tilman Hausherr > Priority: Minor > Labels: tiff > Attachments: ImageIOUtil.patch, TestImageIOUtils.patch > > > ImageIoUtil.WriteImage brings an I/O error exception when trying to write a > tiff file. Debugging shows that the cause is "Bits per sample must be 1 for > RLE compression!". This means that the compression used (the first one of the > following list, returned by writerParams.getCompressionTypes() ) is only > allowed for bitonal images. > CCITT RLE > CCITT T.4 > CCITT T.6 > LZW > JPEG > ZLib > PackBits > Deflate > EXIF JPEG > After correcting this, the next problem was that tiff images didn't have the > proper resolutions. I added that too. Yes it uses the com.sun.* classes; > however there is no other way. Even apache xmlgraphics uses them, although in > a very different way than I do > https://svn.apache.org/repos/asf/xmlgraphics/commons/tags/commons-1_3_1/src/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriter.java > writeImage() has a parameter "int imageType" which is never used. Why? -- This message was sent by Atlassian JIRA (v6.1.5#6160)