Hi everyone,

I needed support for PNG images to produce a PDF document, so I hacked
in support for it, using the Sixlegs PNG decoder[1], which is under
LGPL, so I guess this code can go into FOP if you folks want it.

What I did:

 - created a new class PngImage, which is almost a straight copy of
   GifImage, and

 - changed the name of the class being created for image/png in
   FopImageFactory.

That was enough to make it work, though if support for image type
sniffing is needed I guess I could add that as well. If so, where do I
do it?

Also, it seems to me like the GifImage class could be abstracted so
that we could have something like

  AbstractFopImage
  |
  +--AbstractImageProducerImage
     |
     +--GifImage
     +--PngImage

The AbstractImageProducerImage would be nearly identical to the
current GifImage, except that it would have an abstract method for
creating the ImageProducer object. The GifImage would then do it as it
does it today, and the PngImage would be a one-liner that creates the
Sixlegs ImageProducer instead.

It may well be that other of the image classes could then be
one-liners as well; I haven't looked into that.

Anyway, if there's interest I could contribute this code in whichever
way is most convenient for the project.


[1] <URL: http://www.sixlegs.com/software/png/ >

-- 
Lars Marius Garshol, Ontopian         <URL: http://www.ontopia.net >
GSM: +47 98 21 55 50                  <URL: http://www.garshol.priv.no >


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to