Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.0-alpha1
-
None
-
None
Description
I am trying to create a PDF using PDFbox with Commons Imaging for loading images. Commons imaging fixes most of the issues I have with the alternatives, but still cannot load my tiff files correctly.
I have attached a resulting PDF as result.pdf.
The files I use for testing, are attached in image_pages.zip. The tiff-files, which are not loaded correctly, are LZW-compressed, and that is the only difference I can find in the format.
All images look the same if I save them to separate image files in another format, as they do in the PDF, so PDFbox does not seem to be the one to blame. My code for reading the files is pretty straightforward:
ImageInfo imageInfo = Imaging.getImageInfo(imageBytes); if (imageInfo.getNumberOfImages() > 1) { List<BufferedImage> allBufferedImages = Imaging.getAllBufferedImages(imageBytes); for (BufferedImage bufferedImage : allBufferedImages) { appendImagePage(bufferedImage); } } else { appendImagePage(Imaging.getBufferedImage(imageBytes)); }