Forum OpenACS Development: Re: Photo-Album Includelet for Xowiki

Collapse
Posted by Dave Bauer on
Package_name refers to pl/sql package for the pl/sql procedures associated with that type. On postgresql its the first half of the function names ie: image__new.

If you want the content repository to generate thumbnails, a simple solution is to use the image content type and reference the image urls like so:

mysite.com/image/${image_id}/thumbnail

This will generate the resized image on the first reference and just download the correct size thereafter.

There are also image::* tcl procedures to do this if you want to generate the thumbnails on upload.

Collapse
Posted by Richard Hamilton on
Dave,

Thank you. It would be great to have the creation of thumbnails and potentially intermediate sized images completely abstracted into the content repository. I have spent the last hour or so hacking away at an example image in an effort to get it to show up in an xowiki instance, but I think it won't unless it is a subtype of an xowiki content type such as ::xowiki::File.

Perhaps the question I need to ask is how easy would it be to extend the functionality you have described to work on ::xowiki::File objects of mime type 'image/pjpeg'?

Collapse
Posted by Richard Hamilton on
So am I correct in thinking that once an image is uploaded, you call:

image::resize [ -item_id item_id ] [ -revision_id revision_id ] [ -size_name size_name ]

and the CR automatically creates the new sizes and stores them as children of the item_id.

To retrieve them you call:

image::get_size_item_id [ -item_id item_id ] [ -size_name size_name ]

specifying the appropriate image size or use the virtual url handler you described.

R.

Collapse
Posted by Dave Bauer on
Yes you have it correct.
Collapse
Posted by Richard Hamilton on
I have been testing some new display options for the xowiki yui-carousel includelet which makes good use of the content repository image re-sizing features.

Along the way I have been testing performance with quite large numbers of thumbnails, and I happened to notice that the imagemagick default quality for a 90 x 60 .jpg thumbnail results in a 25KB+ image. This is way too big since I can produce a thumbnail visually indistinguishable from it in about 2.5KB using Photoshop.

As a quick and dirty performance improvement I can simply manually re-process the cached thumbnail files, but I thought it might be a useful addition to enable the required default output quality to either be passed in when the procs are called or put in an OpenACS kernel parameter alongside the path to ImageMagick.

Any thoughts?

Regards
Richard