Natim / Thumbnailer

A service that take an url and returns a thumbnail
9 stars 2 forks source link

Use configuration file to declare available engines #12

Open benoitbryon opened 12 years ago

benoitbryon commented 12 years ago

Note: focus on engines for now. Use default reader and writers.

benoitbryon commented 12 years ago

Proposal for some configuration file:

[thumbnailer]
engines = 
    crop
    scale
    favicon

[crop]
engine = thumbnailer.engines.images.Crop

[scale]
engine = thumbnailer.engines.images.Scale

[favicon]
engine =
    thumbnailer.engines.images.Crop
    thumbnailer.engines.images.Scale
width = 32
height = 32

Gives following URLs:

benoitbryon commented 12 years ago

or, if we need atomic configuration for each chained engine :

[favicon]
chain =
    crop-square
    scale32

[crop-square]
engine = thumbnailer.engines.images.crop
width = 400
height = 400

[scale32]
engine = thumbnailer.engines.images.Scale
width = 32