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

Tilman Hausherr commented on PDFBOX-1969:
-----------------------------------------

I tried by creating an ARGB image with partially set alpha values. It fails in 
ImageFactory.getAlphaImage() with an exception. It asks whether the color model 
created in getAlphaImage() is compatible with the raster from getAlphaRaster(), 
and looking at the JDK sources this is never true if it is not a 
ComponentSampleModel. However the sample model of the alpha raster is a 
SinglePixelPackedSampleModel. Makes me wonder if this has _ever_ worked - the 
1.8 code also combines the alphaRaster with a ComponentColorModel.

I did some more changes in rev 1577878:
- removed that "jpeg only" part in JPEGFactory per DRY and replaced it with a 
call to ImageIOUtils
- prepared a test for ARGB, but disabled it
- removed a line in createJPEG() that I had inserted and that made no sense
- added a graphics.dispose() call in ImageFactory


> JPEGFactory bug
> ---------------
>
>                 Key: PDFBOX-1969
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1969
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Steven Burg
>             Fix For: 2.0.0
>
>
> Attempted to run the RubberStampWithImage sample and received the following 
> errors:
> Exception in thread "main" java.lang.NullPointerException
>    at 
> org.apache.pdfbox.pdmodel.graphics.image.JPEGFactory.createFromStream(JPEGFactory.java:72)
>    at 
> org.apache.pdfbox.examples.pdmodel.RubberStampWithImage.doIt(RubberStampWithImage.java:93)
>    at 
> org.apache.pdfbox.examples.pdmodel.RubberStampWithImage.main(RubberStampWithImage.java:185)
> This happens with any jog I tested with.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to