cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: Image Serializers
Date Mon, 10 Apr 2000 20:12:42 GMT
On Mon, 10 Apr 2000, Ross Burton wrote:

> I've been fiddling today with the SVG serializer, and have come to several
> conclusions:
> 
> 1) the demo SVGs which come with IBM's SVGView don't work, unless I delete
> the DOCTYPE declaration (I get an Invalid Character error from Xerces) even
> though the DTDs are in the same directory.  The SVG-ified Cocoon 2 logo also
> fails to work.
> 
> 2) The example sitemap needs the SVG serializer added to it (along with
> ImageSerializer and FO2PDFSerializer)
> 
> 3) IMHO, the image serializers need more abstraction.
> 
> At the moment all SVG files (SVGSerializer) and <image> tags
> (ImageSerializer) are encoded using the Sun JPEG encoder, set to maximum
> quality.  Although this works, it is hacky (IMHO):
> 
> * What if I want an alpha channel?
> * What if I want exact detail in the image, which JPEG will remove
> * What if I want to reduce the compression ratio, so that images are smaller
> (high quality JPEGs can be large)
> 
> I propose the creation of this interface:
> 
>     package org.apache.cocoon.serializers.image;
> 
>     public interface ImageWriter implements Component, Configurable {
>         void init(Configuration conf);
>         String getContentType();
>         encode(BufferedImage image, OutputStream out) throws IOException ;
>     }
> 
> (This name is not perfect, but ImageSerializer is already used)

I think this sounds look a good component to have around. Dunno about your
choice of names or positions in the hierarchy, but I'm sure Pier will
chime in at some point.

- donald


Mime
View raw message