Bug 33383 - NPE while loading GIF image
Summary: NPE while loading GIF image
Status: CLOSED WONTFIX
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: images (show other bugs)
Version: trunk
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-03 10:58 UTC by Jeremias Maerki
Modified: 2012-04-01 13:51 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremias Maerki 2005-02-03 10:58:05 UTC
list.fo seems to process without error now, except for the following NPE
while loading a GIF image.

java.lang.NullPointerException
	at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:97)
	at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:106)
	at sun.awt.image.InputStreamImageSource.doFetch
(InputStreamImageSource.java:240)
	at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
	at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)

I've found various posts on the net from people who have the same effect
but not necessarily the same circumstances. In GifImage we load the image from 
an InputStream using a "DummyConnection" which is a URLConnection. However, 
the Sun ContentHandler for GIF images seems to use their own URLImageSource (a 
ImageProducer descendant) which wants the URL in the URLConnection to be non-
null. Sun also has a InputStreamImageSource internally which they should 
probably use in this case.

I tried supplying a dummy URL to see if the code would still use the 
InputStream that was supplied, but the image was loaded from the URL. So it 
actually opens a new connection.

If anyone has an idea for a work-around, that would be cool.

Happens under Sun JDKs 1.4.2_06 and 1.5.0_01.
Comment 1 Jeremias Maerki 2008-04-03 01:09:12 UTC
GIF loading is now done through ImageIO. This bug is obsolete.
Comment 2 Glenn Adams 2012-04-01 13:51:41 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs