Nuxeo mailing list archives
[CPS-devel] Imagegallery
Michael Schulz
mschulz at webgis.de
Tue Apr 17 14:24:12 CEST 2007
Hi,
comments inline ...
> > At the moment, this type holds the original image and calculates a
> > thumbnail, additionally it stores the thumbnail size in a int Field.
> >
> > I'd like to be able to change the thumbnail size field value and then
> > re-thumbnail the original image. At the moment, since the original
> > image data is not changed, it justs preserves both images.
> >
> > How could i achieve this?
>
> I have no clean solutions to offer currently. By coincidence, I've
> been working lately on dependencies for
> write process expressions (see https://svn.nuxeo.org/trac/pub/ticket/
> 1830)
> but computeDependantFields is another story; the computation is
> actually done in DataModel, before the
> write expressions are evaluated by storage adapters. Adding some
> dependencies following there would have
> unwanted side effects.
I've taken a step back and changed the approach instead of using a new
image field type that can manipulate dependant fields, I switched to
using a new Integer field type, that holds the size value of the
thumbnail to compute. Thereby i could overcome the problem that the
resizing is triggered only when a new original image is uploaded, to a
resizing thats triggered when the size is changed.
> > Maybe thios could be solved with a new action without customizing the
> > document edit method.
>
> It's a matter of UI. I guess a new action could be clearer for the
> user: they might better understand that the change is active.
> If you have a new action, then you can avoid the workflow script,
> hence the duplication.
I'll try that way.
> By the way, what you're implementing is generic and useful, so I'd
> like to invite you to eventually include it in CPS for the 3.4.5
> timeframe.
> Requirements for that would be that:
> - it doesn't break if PIL is missing.
> - dependent fields and size field ids are configurable, so that it's
> possible to resolve potential naming collisions.
>
> A unit test for the computeDependantFields would be a nice icing on
> the cake, too ;-)
Great, I'll send you the changes when finished, so you can have a
look. At the moment it's more a pragmatic approach, but in the future
...
Cheers, Michael
-----------------------------------------------------------
Michael Schulz
mschulz at webgis.de
in medias res
Gesellschaft für Informationstechnologie mbH
In den Weihermatten 66
79108 Freiburg
Tel +49 (0)761 556959-5
Fax +49 (0)761 556959-6
http://www.webgis.de / http://www.zopecms.de
-----------------------------------------------------------
This list archive provided by Nuxeo, the
leaders of open source ECM.
Check out the Nuxeo 5 open source,
standards-based ECM project.