Hi Bertrand,

After having a bit of time to think about this I think your suggestion to have a java component to do this would be a good idea, and if then there is a specific image scripting language built around that then so be it.

Have spent a bit of time over the past few days looking into and trying to integrate JAI and ImageIO into a bundle built by maven etc. etc. (and half the time spent beating my head against a wall). I am not sure how well using these libraries will work due to having to download them from Sun's site rather than automatically getting them from a maven repository.

So this has set me back a bit.

Bertrand Delacretaz wrote:
Creating a java component (in a bundle) that implements these
operations would make that usable from any scripting language and
servlet, for example:

  // myResourceType.png script
  var s = sling.getService(org.apache.sling.imaging.Processor);
  var p = s.getImageProcessor();
  if(request.selectors[0] == "small") {
    p.scale = 0.5;
  } else {
    p.scale = 1;
  }
  p.rotation = 90;
  p.outputFormat = png;
  p.watermark = currentNode.getPath() + ".watermark.png";
  p.metadata.title = currentNode.title;
  p.render(currentNode,response);

And the image processor might also provide a simple way to store the
output in the repository, as an option to dynamic rendering.
...
Thanks for your suggestions, and I'm sure we'll do our best to help if
you're willing to work on this.

I'm sure you notice my "subtle" hints to people who might contribute
useful stuff to Sling ;-)

Considering that the core is fairly stable now, and that important
functions like what you describe are still missing, I think it's a
really good time to get involved.

-Bertrand
Very interested in working on this (doing this outside normal work hours as a side project, though using sling within work for more general site development).

Cheers
Bryce

Reply via email to