xmlgraphics-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: support for ImageReader.addIIOReadWarningListener()
Date Thu, 09 Apr 2009 18:27:28 GMT
Hi Philippe

On 09.04.2009 15:14:41 Cadé Philippe wrote:
> Hi all,
> 
> I hope this is the right place for this, if not please advise.

Totally the right place. :-)

> Here some context information: using xmlgraphics 1.3.1 via FOP to
> transform XML to PDF, my XSLT uses external-graphics that reference CGM
> files. CGM files are read using an ImageIO plugin.

Interesting. CGM is a vector graphic format, right? So if you're using
an ImageIO plugin, that means the CGM images get converted to bitmaps.
If you can send the vector graphics against a Graphics2D interface, you
could write an image loader plug-in and transform the images to vector
graphics in PDF output. That's what we do with SVG or MathML, for
example. Just an thought.

> We are currently not supporting all CGM commands and are generating
> warning messages while parsing the image, I'd like to have access to
> those messages. Now the ImageReader class provides the possibility to
> add a IIOReadWarningListener that would be perfect for this.
> 
> Question is now: what is the best way to add support for this? I am
> thinking that adding a addIIOReadWarningListener() method to
> ImageManager would work, FOP could then have this listener log the
> messages to the existing log file (cf. ExternalGraphics.bind()). Or
> would it be better to encapsulate the IIOReadWarningListener into
> another interface? Or use another access point than ImageManager?
> 
> What do you guys think?

Hmm, I wouldn't like to see a hard dependency on the listener interface in
any of the API classes of the image loading framework. Ok, I've reused
ImageIO's ImageInputStream in the image loading framework but adding
something to the API classes that is specific to a single plug-in
doesn't feel right. Just for my understanding: is your goal to simply redirect
the warnings from the interface to the logger or do you actually want to
provide your own IIOReadWarningListener from your client code? In the
first case, I'd suggest just extending the ImageIO plugin for the image
loading framework (ImageLoaderImageIO and PreloaderImageIO). That's
easily done in a few lines of code. The second case is more complicated
and invasive. For the image loader, the "hints" parameter of the
ImageLoader's loadImage() method might help here. However, there's no
equivalent for the Preloader stage, yet.

> Thanks for your help
> Philippe




Jeremias Maerki


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


Mime
View raw message