[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-03 Thread Kamil (JIRA)

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

Kamil commented on PDFBOX-4176:
---

Thanks!

> 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
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.10, 3.0.0 PDFBox
>
>
> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-03 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

It turned out to be easier than I thought - just catch the checked exception.

> 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
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.10, 3.0.0 PDFBox
>
> Attachments: cmyk.jpeg, 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-03 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on PDFBOX-4176:
-

Commit 1828259 from [~tilman] in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1828259 ]

PDFBOX-4176: support valid TIFF files that are not processed by the TIFF 
factory; disable buggy .ARW detection; improve exception message

> 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
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.10, 3.0.0 PDFBox
>
> Attachments: cmyk.jpeg, 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-03 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on PDFBOX-4176:
-

Commit 1828258 from [~tilman] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1828258 ]

PDFBOX-4176: support valid TIFF files that are not processed by the TIFF 
factory; disable buggy .ARW detection; improve exception message

> 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
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.10, 3.0.0 PDFBox
>
> Attachments: cmyk.jpeg, 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Kamil (JIRA)

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

Kamil commented on PDFBOX-4176:
---

that would be great! Thanks [~tilman]

> 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
> Fix For: 2.0.10, 3.0.0 PDFBox
>
> Attachments: cmyk.jpeg, 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

I have to admit that yes, a user would expect that 
{{PDImageXObject.createFromByteArray}} can do all... what we could do is that 
if it is a TIF, then investigate the TIF tags (as done in 
{{CCITTFactory.extractFromTiff}}) to check whether the TIF factory can handle 
it. If not, then handle it like "other".

> 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
> Fix For: 2.0.10, 3.0.0 PDFBox
>
> Attachments: cmyk.jpeg, 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

ImageIO can't read CMYK jpeg images directly. You can use the twelvemonkeys 
library instead. Or use {{PDImageXObject.createFromByteArray}} which works for 
that case (because PDFBox reads the raster).

https://github.com/haraldk/TwelveMonkeys

> 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
> Fix For: 2.0.10, 3.0.0 PDFBox
>
> Attachments: cmyk.jpeg, 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Kamil (JIRA)

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

Kamil commented on PDFBOX-4176:
---

Ok, this is even more tricky...
{code:java}
final PDImageXObject jpeg = PDImageXObject.createFromByteArray(doc, 
IOUtils.toByteArray(new FileInputStream(tiffFile)), "tiff.tif");
{code}
fails on "tiff.tif", but works on "cmyk.jpeg" (in attachment)
while:
{code}
final PDImageXObject jpeg = LosslessFactory.createFromImage(doc, 
ImageIO.read(new File("cmyk.jpeg")));
{code}
works for "tiff.tif" but fails for "cmyk.jpeg" with:
{code}
javax.imageio.IIOException: Unsupported Image Type
at 
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1182)
at 
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:1153)
at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1468)
at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1315)

{code}
 
If "LosslessFactory.createFromImage" works for "tiff.tif" then maybe there is 
possibility, to make "PDImageXObject.createFromByteArray" work as well?

 

> 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
> Fix For: 2.0.10, 3.0.0 PDFBox
>
> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

The part that it is recognized as ARW can be fixed either by the person who 
wrote that part, or by me (by removing the ARW file type from the list). The 
part "First image in tiff is not CCITT T4 or T6 compressed" cannot because PDF 
doesn't support color in the CCITT filter. What it means is that even if I fix 
the part that it isn't detected as a TIF, you still can't use the method 
(unless your production images are G3 or G4 compressed b/w images.

> 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
> Fix For: 2.0.10, 3.0.0 PDFBox
>
> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Kamil (JIRA)

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

Kamil commented on PDFBOX-4176:
---

{quote}Because there's a bug in the file type detector.
{quote}
Can bug in file type detector be fixed?
{quote}There's an issue on github... if it hasn't been fixed by 2.0.10 release 
time, then I'll just remove a few file types from our code copy.
{quote}
I didn't understand that. Does it mean that there is possibility to fix my 
issue?

> 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
> Fix For: 2.0.10, 3.0.0 PDFBox
>
> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

There's an issue on github... if it hasn't been fixed by 2.0.10 release time, 
then I'll just remove a few file types from our code copy.

> 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
> Fix For: 2.0.10, 3.0.0 PDFBox
>
> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

("CCITT T4 or T6" is the same as "G3 or G4 compression", just in case it is 
getting confusing)

> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

Ooops, I think you're asking about "First image in tiff is not CCITT T4 or T6 
compressed". That is because PDFBox can use the existing compression for TIFF 
files with these compressions, i.e. doesn't have to decompress first.

> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Kamil (JIRA)

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

Kamil commented on PDFBOX-4176:
---

So how
ImageIO.read(file)
can read it correctly?

 

> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

The file is misidentified as ARW. Even if this bug would be fixed, it would 
still fail, because it is a color image 
 {code}
Exception in thread "main" java.io.IOException: First image in tiff is not 
CCITT T4 or T6 compressed
at 
org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.extractFromTiff(CCITTFactory.java:433)
at 
org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.createFromRandomAccessImpl(CCITTFactory.java:214)
at 
org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.createFromByteArray(CCITTFactory.java:132)
at 
org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.createFromByteArray(CCITTFactory.java:109)
at 
org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.createFromByteArray(PDImageXObject.java:319)
 {code}


> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Kamil (JIRA)

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

Kamil commented on PDFBOX-4176:
---

By the way - if I use this workaround, it works fine:

{code}
private BufferedImage workaround(final File file) throws IOException {
BufferedImage imgIn = ImageIO.read(file);
if(imgIn.getType() != BufferedImage.TYPE_INT_RGB){
final BufferedImage newImage = new BufferedImage(imgIn.getWidth(), 
imgIn.getHeight(), BufferedImage.TYPE_INT_RGB);
newImage.createGraphics().drawImage(imgIn, 0, 0, Color.WHITE, null);
imgIn = newImage;
}
return imgIn;
  }
{code}

> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Kamil (JIRA)

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

Kamil commented on PDFBOX-4176:
---

To check it, you can use the code from this issue: 
https://issues.apache.org/jira/browse/PDFBOX-4176

and file from the attachment

> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

Alternatively, use {{PDImageXObject.createFromFileByExtension()}} and see what 
happens.

> 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
>
> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Maruan Sahyoun (JIRA)

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

Maruan Sahyoun commented on PDFBOX-4176:


Could you test with {{PDImageXObject.createFromFileByContent}}. 

The message is generated because the content of the {{byte[]}} is not detected 
to be a TIFF image by the {{FileTypeDetector}}.  Are you sure that you are 
passing a TIFF image?

If that doesn't help please attach the TIFF in question.

> 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
>
> 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



[jira] [Commented] (PDFBOX-4176) PDImageXObject doesn't support TIFF although JavaDoc says it does

2018-04-02 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-4176:
-

Could you please attach the file? The exception message only tells the name, 
and not the file type that is detected by content. Alternatively, call 
{{FileTypeDetector.detectFileType(byteArray)}} and tell the result.

> 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
>
> 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