[Typo3-dev] Image Processing API - getting rid of IM
Ernesto Baschny
ernst at baschny.de
Tue Sep 21 17:05:10 CEST 2004
On 21 Sep 2004, Christian Jul Jensen wrote:
> Daniel Brün <dbruen at saltation.de> writes:
> > If someone has the time to define a fresh API based on design
> > patterns... go ahead!
> > My first guess would be to develop some kind of base-interface-class
> > that has to be implemented by a class using whatever image-processing
> > library. In order to do so, a set of useful
> > image-processing-operations should be investigated, first.
You might want to take a look at the development of Gallery2 (G2), which
has exactly this kind of API, called "GraphicsToolkit". Any module can
provide a new graphics toolkit, and it just has to register with the core
on which MIME-types which graphical operations can be applied and which
parameters are required for each one.
Currently our implementations have a limited set of operations that we
need in this alpha stage of Gallery2 (scale, resize, thumbnail, composite,
rotate and crop), but any toolkit can register any other operation it
wants to. The core handles the delegation of requests, using the
registered implementations (e.g. to make a thumbnail of a Mpeg or a PDF,
etc) and running through the standard API.
We already have implemented the Graphics Toolkit for Ffmpeg,
ImageMagick/GraphicsMagick, GD2, NetPBM. We even have "pseudo" Toolkits
that register certain operations to be able to pre/pos-process a file,
for example a SquareThumbToolkit which registers the "thumbnail" operation
and makes sure the generated thumbnail has equal height/width or a
"ThumbnailToolkit" which provides standard thumbnails for MIME Types for
which there is no other handler (e.g. a "movie" icon for movies).
I think this is a powerful instrument, maybe you could take some ideas
from it.
Cheers,
Ernesto
More information about the TYPO3-dev
mailing list