Hi,

I am thinking of creating a way of doing image rendering through sling and thought I would first check with the community as to whether this has been thought of, and whether there are any thoughts on how this may work.

Thoughts that I have had as to what this can be used for are (among others):
   * scaling
   * rotation
   * watermarking
   * layering (i.e. use one image as background another as foreground)
   * format changing e.g. png -> jpg
   * quality change (to reduce size of say jpg)

So say /img/test is a png image (with sling:resourceType = "abc/def") and I requested /img/test.jpg that something would reformat the image from png to jpg. If I requested /img/test.small.jpg the image would be reduced and the format changed.

So I guess the most "basic" way of doing this would be to write a servlet that specifically did a certain type of image creation / manipulation. But this seems a little tedious to me, and not very customizable by someone in the future. Another thought would be that something like JSP or Groovy would be used to do the image manipulation and there was a script that did this say: /apps/abc/def/jpg.jsp

One of the issues I see with this is that it would require the imageio and jai libraries to be added somewhere that would then be visible to this even though in most cases nobody would use jsp for this etc. Also I don't think this would be that easy for someone who doesn't know a reasonable amount about jai and imageio.

What I have been thinking about and what I am proposing is another scripting bundle that is specifically used for image creation and manipulation. This would then have some sort of source (still thinking about how this would work) that would define the processing to perform. Initial thoughts are something along the lines of a set of parameterized JAI operators, e.g. SubsampleAverageDescriptor, UnsharpMaskDescriptor, AddDescriptor.

Maybe not strictly a script either but a set of nodes in the repository which makes up the "script"?

Would be interested in any feedback, other options etc. before I start design / development of this.

Cheers
Bryce

Reply via email to