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

Collapse
Posted by Torben Brosten on
Hi Richard,

The only thought I have is try GraphicsMagick in place of ImageMagick since it's geared more to speed and conserving resources.

cheers,

Torben

Collapse
Posted by Richard Hamilton on
Torben,

Thank you for the reply.

ImageMagick has many command-line parameters and one of them is '-quality'. You pass it a number between 1 and 100 where 1 is poorest and 100 is best. It is supposed to default to the detected quality of the original but I suspect that this is not happening.

My suggestion really is in terms of exposing this option through the OpenACS CR API regardless of the image processor used.

Regards
Richard

Collapse
Posted by Richard Hamilton on
Further to earlier post, I have been playing around with the files and have discovered that most of the data in these thumbnails is color profile data.

If I vary the -quality parameter, the image size doesn't change much, but if I remove the colour profile information my 28KB thumbnail drops to 2.5KB as expected.

An embedded profile in a thumbnail is really not necessary, however the CR and xowiki code is designed to work at any image size. I wonder therefore if it be handy to be able to pass through to the image resize proc whether or not to remove the color profile. Certainly, this could then be supported as a parameter in the yui-carousel includelet.

My version of ImageMagick is old and so I have to do:

convert +profile '' -quality 45% in.jpg out.jpg

For newer versions you can use the -strip parameter.

I will try compiling GraphicsMagick as Torben suggested because ImageMagick won't compile on my (rather old!) linux distribution.

Regards
Richard

Collapse
Posted by Dave Bauer on
OK, here is what I recommend.

Change the return style from image::convert_to_sizes to return something like this:

[list [list thumbnail {-strip -resize 150x150} view {-strip -resize 500x500]]

and fix the callers to intepret the new format. Since this is a private procedure and it is only called in two places, and only one place actually uses the dimensions part of the size specification.

Collapse
Posted by Richard Hamilton on
Dave,

That sounds like a good suggestion. The only problem I foresee with that is that putting -strip in there will cause an error on earlier versions of ImageMagick.

It would also be useful to apply a change to the xowiki specific image resizing code.

Regards
Richard