You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Joel Hirsh <jo...@gmail.com> on 2016/04/22 23:19:46 UTC

Exception caused by logo image

Getting an exception on the logo in this file.  It is repeatable with
PrintImageLocations test program.  I tried this both in 2.0.0 and the 2.0.1
development build from 4/22.  If I delete the logo from the PDF then the
error goes away.

The PDF with just the logo is attached.

Looking at the pdfbox code it seems that it might just be an exception that
needs to be caught, and then try an alternative image parser.

Exception in thread "main" java.lang.IllegalArgumentException: Numbers of
source Raster bands and source color space components do not match
at java.awt.image.ColorConvertOp.filter(Unknown Source)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.acceptPixels(Unknown Source)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
at javax.imageio.ImageReader.read(Unknown Source)
at org.apache.pdfbox.filter.DCTFilter.decode(DCTFilter.java:83)
at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:69)
at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:163)
at
org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:235)
at
org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.<init>(PDImageXObject.java:147)
at
org.apache.pdfbox.pdmodel.graphics.PDXObject.createXObject(PDXObject.java:70)
at org.apache.pdfbox.pdmodel.PDResources.getXObject(PDResources.java:385)
at
org.apache.pdfbox.examples.util.PrintImageLocations.processOperator(PrintImageLocations.java:118)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:472)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:446)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
at
org.apache.pdfbox.examples.util.PrintImageLocations.main(PrintImageLocations.java:90)

Thanks

Re: Exception caused by logo image

Posted by Tilman Hausherr <TH...@t-online.de>.
Sorry, I see my mail was messed up. Just go to

https://github.com/haraldk/TwelveMonkeys

and scroll to the bottom (almost). It's really very easy to use.

Tilman

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Exception caused by logo image

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 23.04.2016 um 07:35 schrieb Joel Hirsh:
> The file is at
> https://www.dropbox.com/s/ic8jps9mmxuz0gl/image%20error.pdf?dl=0
>
> twelvemonkeys sounds interesting.  What needs to be done to integrate
> twelvemonkeys?  Could it possibly be as easy as building with the jar file?

See on https://github.com/haraldk/TwelveMonkeys .. with maven you just 
add this

|<dependency> <groupId>com.twelvemonkeys.imageio</groupId> 
<artifactId>imageio-jpeg</artifactId> <version>3.2.1</version> 
</dependency>|


or download the six files needed and put them into your classpath.

|twelvemonkeys-common-lang-3.2.1.jar twelvemonkeys-common-io-3.2.1.jar 
twelvemonkeys-common-image-3.2.1.jar 
twelvemonkeys-imageio-core-3.2.1.jar 
twelvemonkeys-imageio-metadata-3.2.1.jar 
twelvemonkeys-imageio-jpeg-3.2.1.jar |


Your file displays when using twelvemonkeys :-) It is yet another bug in 
java imaging.

See also
https://issues.apache.org/jira/browse/PDFBOX-2694

Tilman

>
> Thanks much.
>
> On Fri, Apr 22, 2016 at 2:39 PM, Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> Please upload the PDF somewhere, attachments don't go through.
>>
>> You can also try to use twelvemonkeys instead of java imaging
>> https://github.com/haraldk/TwelveMonkeys
>> it works nicely for me.
>>
>> Tilman
>>
>>
>> Am 22.04.2016 um 23:19 schrieb Joel Hirsh:
>>
>>> Getting an exception on the logo in this file.  It is repeatable with
>>> PrintImageLocations test program.  I tried this both in 2.0.0 and the 2.0.1
>>> development build from 4/22. If I delete the logo from the PDF then the
>>> error goes away.
>>>
>>> The PDF with just the logo is attached.
>>>
>>> Looking at the pdfbox code it seems that it might just be an exception
>>> that needs to be caught, and then try an alternative image parser.
>>>
>>> Exception in thread "main" java.lang.IllegalArgumentException: Numbers of
>>> source Raster bands and source color space components do not match
>>> at java.awt.image.ColorConvertOp.filter(Unknown Source)
>>> at com.sun.imageio.plugins.jpeg.JPEGImageReader.acceptPixels(Unknown
>>> Source)
>>> at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
>>> at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown
>>> Source)
>>> at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
>>> at javax.imageio.ImageReader.read(Unknown Source)
>>> at org.apache.pdfbox.filter.DCTFilter.decode(DCTFilter.java:83)
>>> at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:69)
>>> at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:163)
>>> at
>>> org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:235)
>>> at
>>> org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.<init>(PDImageXObject.java:147)
>>> at
>>> org.apache.pdfbox.pdmodel.graphics.PDXObject.createXObject(PDXObject.java:70)
>>> at org.apache.pdfbox.pdmodel.PDResources.getXObject(PDResources.java:385)
>>> at
>>> org.apache.pdfbox.examples.util.PrintImageLocations.processOperator(PrintImageLocations.java:118)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:472)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:446)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
>>> at
>>> org.apache.pdfbox.examples.util.PrintImageLocations.main(PrintImageLocations.java:90)
>>>
>>> Thanks
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>


Re: Exception caused by logo image

Posted by Joel Hirsh <jo...@gmail.com>.
The file is at
https://www.dropbox.com/s/ic8jps9mmxuz0gl/image%20error.pdf?dl=0

twelvemonkeys sounds interesting.  What needs to be done to integrate
twelvemonkeys?  Could it possibly be as easy as building with the jar file?

Thanks much.

On Fri, Apr 22, 2016 at 2:39 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> Please upload the PDF somewhere, attachments don't go through.
>
> You can also try to use twelvemonkeys instead of java imaging
> https://github.com/haraldk/TwelveMonkeys
> it works nicely for me.
>
> Tilman
>
>
> Am 22.04.2016 um 23:19 schrieb Joel Hirsh:
>
>> Getting an exception on the logo in this file.  It is repeatable with
>> PrintImageLocations test program.  I tried this both in 2.0.0 and the 2.0.1
>> development build from 4/22. If I delete the logo from the PDF then the
>> error goes away.
>>
>> The PDF with just the logo is attached.
>>
>> Looking at the pdfbox code it seems that it might just be an exception
>> that needs to be caught, and then try an alternative image parser.
>>
>> Exception in thread "main" java.lang.IllegalArgumentException: Numbers of
>> source Raster bands and source color space components do not match
>> at java.awt.image.ColorConvertOp.filter(Unknown Source)
>> at com.sun.imageio.plugins.jpeg.JPEGImageReader.acceptPixels(Unknown
>> Source)
>> at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
>> at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown
>> Source)
>> at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
>> at javax.imageio.ImageReader.read(Unknown Source)
>> at org.apache.pdfbox.filter.DCTFilter.decode(DCTFilter.java:83)
>> at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:69)
>> at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:163)
>> at
>> org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:235)
>> at
>> org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.<init>(PDImageXObject.java:147)
>> at
>> org.apache.pdfbox.pdmodel.graphics.PDXObject.createXObject(PDXObject.java:70)
>> at org.apache.pdfbox.pdmodel.PDResources.getXObject(PDResources.java:385)
>> at
>> org.apache.pdfbox.examples.util.PrintImageLocations.processOperator(PrintImageLocations.java:118)
>> at
>> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:472)
>> at
>> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:446)
>> at
>> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
>> at
>> org.apache.pdfbox.examples.util.PrintImageLocations.main(PrintImageLocations.java:90)
>>
>> Thanks
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>
>

Re: Exception caused by logo image

Posted by Tilman Hausherr <TH...@t-online.de>.
Please upload the PDF somewhere, attachments don't go through.

You can also try to use twelvemonkeys instead of java imaging
https://github.com/haraldk/TwelveMonkeys
it works nicely for me.

Tilman

Am 22.04.2016 um 23:19 schrieb Joel Hirsh:
> Getting an exception on the logo in this file.  It is repeatable with 
> PrintImageLocations test program.  I tried this both in 2.0.0 and the 
> 2.0.1 development build from 4/22. If I delete the logo from the PDF 
> then the error goes away.
>
> The PDF with just the logo is attached.
>
> Looking at the pdfbox code it seems that it might just be an exception 
> that needs to be caught, and then try an alternative image parser.
>
> Exception in thread "main" java.lang.IllegalArgumentException: Numbers 
> of source Raster bands and source color space components do not match
> at java.awt.image.ColorConvertOp.filter(Unknown Source)
> at com.sun.imageio.plugins.jpeg.JPEGImageReader.acceptPixels(Unknown 
> Source)
> at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
> at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown 
> Source)
> at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
> at javax.imageio.ImageReader.read(Unknown Source)
> at org.apache.pdfbox.filter.DCTFilter.decode(DCTFilter.java:83)
> at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:69)
> at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:163)
> at 
> org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:235)
> at 
> org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.<init>(PDImageXObject.java:147)
> at 
> org.apache.pdfbox.pdmodel.graphics.PDXObject.createXObject(PDXObject.java:70)
> at org.apache.pdfbox.pdmodel.PDResources.getXObject(PDResources.java:385)
> at 
> org.apache.pdfbox.examples.util.PrintImageLocations.processOperator(PrintImageLocations.java:118)
> at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:472)
> at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:446)
> at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
> at 
> org.apache.pdfbox.examples.util.PrintImageLocations.main(PrintImageLocations.java:90)
>
> Thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org