[ 
https://issues.apache.org/jira/browse/PDFBOX-4176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16422113#comment-16422113
 ] 

Tilman Hausherr edited comment on PDFBOX-4176 at 4/2/18 10:46 AM:
------------------------------------------------------------------

Because there's a bug in the file type detector. The easiest way for you would 
either be to useĀ {{PDImageXObject createFromFile()}} or to use 
{{LosslessFactory.createFromImage(ImageIO.read(file))}}. You'll have to use one 
of these anyway if your production TIFF files are not G3 or G4 encoded.


was (Author: tilman):
Because there's a bug in the file type detector. The easiest way for you would 
either be to useĀ {{PDImageXObject createFromFile()}} or to use 
{{LosslessFactory.createFromImage(ImageIO.read(file))}}. You'll have to use one 
of These anyway if your production TIFF files are not G3 or G4 encoded.

> PDImageXObject doesn't support TIFF although JavaDoc says it does
> -----------------------------------------------------------------
>
>                 Key: PDFBOX-4176
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4176
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.9
>            Reporter: Kamil
>            Priority: Major
>         Attachments: tiff.tif
>
>
> This code:
> {code}
> final PDImageXObject jpeg = PDImageXObject.createFromByteArray(doc, 
> IOUtils.toByteArray(new FileInputStream(tiffFile)), "tiff.tif");
> {code}
> throws:
> {code}
> java.lang.IllegalArgumentException: Image type not supported: tiff.tif
>         at 
> org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.createFromByteArray(PDImageXObject.java:351)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to