commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Matthew Chen <charlesmc...@gmail.com>
Subject Re: [sanselan] Multi-image files and API changes
Date Wed, 17 Nov 2010 18:06:26 GMT
Hi Damjan,

   These are indeed limitations of the current api.

   For the sake of backward compatibility as well as to honor
Sanselan's design principle of making the common case easy (almost all
image files contain a single image, for example) I would suggest
adding new, separate methods/properties.

   ie. something like:

List<Dimension> getImageSizes(...);
void writeImagesToFile(File file, List<BufferedImage> images...,
List<Map<...>> paramMaps);

> 2. There needs to be a way to configure writing better (for example,
> the purpose of the different images in multi-image formats is often to
> store different color depths in one icon file, so there should be a
> way to configure what depth each image gets written in).

   Agreed.  The existing api uses parameter maps (in which all
parameters are optional, I think).  I suggest passing a list of
paramMaps (one for each image) as above.  What do you think?

   IIRC, there are some first steps towards this in the ImageInfo class(es).

   Sounds like an exciting project - this work is overdue.  Thanks for
taking it on.  Let me know if you have any questions.

Matthew


On Wed, Nov 17, 2010 at 6:45 AM, Damjan Jovanovic <damjan.jov@gmail.com> wrote:
> Hi
>
> I've noticed a number of problems with Sanselan's API:
>
> 1. There is a way to read files with multiple images
> (Sanselan.getAllBufferedImages()) but there is no way to write files
> with multiple images. This limits the usability of all multi-image
> file formats.
> 2. There needs to be a way to configure writing better (for example,
> the purpose of the different images in multi-image formats is often to
> store different color depths in one icon file, so there should be a
> way to configure what depth each image gets written in).
> 3. There is heavy confusion between per-image info (eg. width, height,
> bpp) and per-file info (format, MIME type, number of images in total)
> in the ImageInfo class. getImageSize() also doesn't fit multi-image
> formats - which image's size is being queried?
>
> Microsoft's Windows Imaging Component solved the problem by having an
> IWICBitmapDecoder, with methods GetFrameCount() and GetFrame(index)
> (see http://msdn.microsoft.com/en-us/library/ee690086(v=VS.85).aspx).
> The bitmap decoder can be queried for properties of the entire image
> file, while each frame can be queried for properties of that
> individual image.
>
> Sun's javax.imageio has something similar.
>
> How much can I refactor Sanselan's classes? Does any backward
> compatibility need to be maintained (since it's not at version 1.0
> yet)?
>
> Thank you
> Damjan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message