You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by je...@atol.si on 2006/02/14 16:55:19 UTC

fop Trunk - problems with when fetching image via http

Hi !

I'm using FopTrunk version and I have a problem with external graphics.

If try to print an image to PDF from filesystem, works OK.
For example, this works:
<fo:external-graphic src="C:\FOPTrunk\examples\fo\graphics\fop.jpg"/>


This error is printed when I try to print image from via http:

Uncaught error fetching image:
java.lang.NullPointerException
        at sun.awt.image.URLImageSource.getConnection(Unknown Source)
        at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
        at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
        at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
        at sun.awt.image.ImageFetcher.run(Unknown Source)

I tried several notations:
<fo:external-graphic src="
url('http://www.apache.org/images/asf_logo_wide.gif')"/>
<fo:external-graphic src="
url(http://www.apache.org/images/asf_logo_wide.gif)"/>
<fo:external-graphic src="http://www.apache.org/images/asf_logo_wide.gif
"/>
<fo:external-graphic src="'http://www.apache.org/images/asf_logo_wide.gif'
"/>

I did not try my sources with BETA version, but in fop 0.20.5 same code 
works fine (no error retrieving image).

Anyone has any idea what I'm doing wrong ?

Thank you, 

Jelka

Re: fop Trunk - problems with when fetching image via http

Posted by je...@atol.si.
I'm using JDK 1.3.

I did try your suggestion and added JIMI. Now images work just fine !

Thank you !!





Jeremias Maerki <de...@jeremias-maerki.ch> 
14.02.2006 17:09
Please respond to
fop-users@xmlgraphics.apache.org


To
fop-users@xmlgraphics.apache.org
cc

Subject
Re: fop Trunk - problems with <fo:external-graphic> when fetching image 
via http






Please always state which JDK you're using! Almost certainly, this is
FOP falling back to using the GifImage image wrapper which is not
working as it should. Note that this class is more or less a hack. If
FOP is falling back to using GifImage this means that you are using JDK
1.3 or you have not compiled FOP under JDK 1.4 or higher (thus enabling
ImageIO support).

Possibilities for JDK 1.3:
- Add JAI or JIMI and rebuild FOP.

Possibilities for JDK 1.4:
- Rebuild FOP under JDK 1.4 or later
- Add JAI or JIMI and rebuild FOP.

More info:
http://xmlgraphics.apache.org/fop/trunk/graphics.html#packages

I hope that helps.

On 14.02.2006 16:55:19 jelka.kosir wrote:
> Hi !
> 
> I'm using FopTrunk version and I have a problem with external graphics.
> 
> If try to print an image to PDF from filesystem, works OK.
> For example, this works:
> <fo:external-graphic src="C:\FOPTrunk\examples\fo\graphics\fop.jpg"/>
> 
> 
> This error is printed when I try to print image from via http:
> 
> Uncaught error fetching image:
> java.lang.NullPointerException
>         at sun.awt.image.URLImageSource.getConnection(Unknown Source)
>         at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
>         at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
>         at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
>         at sun.awt.image.ImageFetcher.run(Unknown Source)
> 
> I tried several notations:
> <fo:external-graphic src="
> url('http://www.apache.org/images/asf_logo_wide.gif')"/>
> <fo:external-graphic src="
> url(http://www.apache.org/images/asf_logo_wide.gif)"/>
> <fo:external-graphic src="http://www.apache.org/images/asf_logo_wide.gif
> "/>
> <fo:external-graphic 
src="'http://www.apache.org/images/asf_logo_wide.gif'
> "/>
> 
> I did not try my sources with BETA version, but in fop 0.20.5 same code 
> works fine (no error retrieving image).
> 
> Anyone has any idea what I'm doing wrong ?
> 
> Thank you, 
> 
> Jelka



Jeremias Maerki


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



Re: fop Trunk - problems with when fetching image via http

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Please always state which JDK you're using! Almost certainly, this is
FOP falling back to using the GifImage image wrapper which is not
working as it should. Note that this class is more or less a hack. If
FOP is falling back to using GifImage this means that you are using JDK
1.3 or you have not compiled FOP under JDK 1.4 or higher (thus enabling
ImageIO support).

Possibilities for JDK 1.3:
- Add JAI or JIMI and rebuild FOP.

Possibilities for JDK 1.4:
- Rebuild FOP under JDK 1.4 or later
- Add JAI or JIMI and rebuild FOP.

More info:
http://xmlgraphics.apache.org/fop/trunk/graphics.html#packages

I hope that helps.

On 14.02.2006 16:55:19 jelka.kosir wrote:
> Hi !
> 
> I'm using FopTrunk version and I have a problem with external graphics.
> 
> If try to print an image to PDF from filesystem, works OK.
> For example, this works:
> <fo:external-graphic src="C:\FOPTrunk\examples\fo\graphics\fop.jpg"/>
> 
> 
> This error is printed when I try to print image from via http:
> 
> Uncaught error fetching image:
> java.lang.NullPointerException
>         at sun.awt.image.URLImageSource.getConnection(Unknown Source)
>         at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
>         at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
>         at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
>         at sun.awt.image.ImageFetcher.run(Unknown Source)
> 
> I tried several notations:
> <fo:external-graphic src="
> url('http://www.apache.org/images/asf_logo_wide.gif')"/>
> <fo:external-graphic src="
> url(http://www.apache.org/images/asf_logo_wide.gif)"/>
> <fo:external-graphic src="http://www.apache.org/images/asf_logo_wide.gif
> "/>
> <fo:external-graphic src="'http://www.apache.org/images/asf_logo_wide.gif'
> "/>
> 
> I did not try my sources with BETA version, but in fop 0.20.5 same code 
> works fine (no error retrieving image).
> 
> Anyone has any idea what I'm doing wrong ?
> 
> Thank you, 
> 
> Jelka



Jeremias Maerki


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