On 04.03.2009 19:15:54 Andreas Delmelle wrote:
> On 04 Mar 2009, at 09:40, Francesc Alted wrote:
> 
> Hi
> 
> > I've managed to do this (changing the LOGLEVEL from INFO to DEBUG),  
> > and
> > you can see the result in:
> >
> > http://pytables.org/temporal/fop-debug.out
> 
> Ok, so we know for certain that the PreloaderSVG is registered nicely.

Yeah, would have been easier if it wasn't. :-(

> (Below some more info, which is probably only useful for devs)
> Following the trail from where the error message is thrown:
> ExternalGraphic.bind()
> -> commons.image.loader.ImageManager.getImageInfo()
> -> commons.image.loader.ImageManager.preloadImage()
> 
> Now, it seems to me that, depending on the ImagePreloader  
> implementation, it is possible for this error message to appear, even  
> though a preloader was found.
> 
> I mean, looking at ImageManager.preloadImage(), if PreloaderSVG is  
> present, but its preloadImage() returns null due to an internal  
> IOException, then we'll get an ImageException giving the impression  
> that the preloader was not found, while it was merely unable to  
> process the file for some reason.

But the exception should have appeared on Francesc's log in that case
which it didn't.

From the log:
[..]
[DEBUG] AbstractImageSessionContext - Creating new Source for pytables.svg
[ERROR] FONode - Image not available: No ImagePreloader found for pytables.svg
[..]

There should have been a DEBUG-level message between the two if the
PreloaderSVG is used and an IOException occurred. That totally confuses
me.

I've now realized that I format the exception just with a toString()
fallback which will swallow an eventual nested exception. Maybe that
could have given us additional information. But probably not, since it's
clearly originating from ImageManager.preloadImage().

> Is it expected/permitted for a preloader to obtain a null ImageInfo in  
> preloadImage() and simply return it?

Yes

> How do we distinguish between a  
> preloader that is not suited for the file format and one that should  
> be, but is unable to load the file...?

Normally:
- not suited: returns null
- detected but unable: ImageException

However, in the case of SVG, this is difficult since the delegated
method simply throw an IOException if the DOM could not be built.

I've updated the Javadocs for ImagePreloader. It was incomplete.

> Regarding the failing PNG: it's a very long shot, but this could be  
> related to the ImageIO implementation, as the  
> commons.image.loader.impl.imageio.ImageIOPreloader is used for those.

I agree. I had problems with ImageIO PNG codecs before in exotic class
libraries, but we're talking Sun Java and OpenJDK here, although we
still have to treat OpenJDK with care.



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to