[greenstone-devel] ImagePlug with watermark facility

From Stephen DeGabrielle
DateMon, 16 May 2005 01:40:47 +0930
Subject [greenstone-devel] ImagePlug with watermark facility
Hi,

I've been fiddling with the ImagePlug - I wanted to be able to have an
image collection that would:
- display watermarked images to 'unauthenticated' users.
- serve the original image to 'authenticated' users.
I am trying to move towards a collection that works like the
Australian War Memorial one.
(The greenstone plugin facility makes it an obvious choice for
collections required to serve a variety of document types and media -
and OAI compliance for PictureAustralia)

I have modified ImagePlug slightly to watermark the [screen] image if required.

I have also added the -size flag to the imagemagick 'convert' commands
in the plugin, as the man pages for convert indicate;

-snip from 'man convert'
> EXAMPLES
> To make a thumbnail of a JPEG image, use:
>
> convert -size 120x120 cockatoo.jpg -resize 120x120
> +profile "*" thumbnail.jpg
>
> In this example, '-size 120x120' gives a hint to the JPEG decoder that
> the image is going to be downscaled to 120x120, allowing it to run
> faster by avoiding returning full-resolution images to ImageMagick for
> the subsequent resizing operation.
(I am using a iBook 600Mhz G3 so I am a little desperate for speed)

I have attached the modified ImagePlug plugin for your perusal; (and
included a modified strings.rb)

I achieved the authentication goal by using the standard greenstone
authentication in a an unusual way...
(from my collect.cfg)
creatorspdegabrielle@bigpond.com
maintainerspdegabrielle@bigpond.com
publictrue

#set document level authentication
# - collection level wont allow users to search/browse the collectuion
authenticatedocument

#supply an EMPTY list of public documents - this implies that all
documents are private
public_documents
auth_groupscolbuilder
[...]
# nifty specify watermark...
pluginImagePlug -watermark hand6small.gif -screenviewsize 500
# this watermark must live in the $GSDLHOME/collect/<colname>/ folder

#note use of /gsdl/collect/gsarch/index/assoc/[assocfilepath]/[Screen] to
provide link to preview
# should probably just be done the same way as [srclink] and embedded
in doc.xml
# at import time by the plugin...
format SearchVList "<td valign=top>[link][icon][/link]</td>
<td valign=top>[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]<br />
<a href='/gsdl/collect/gsarch/index/assoc/[assocfilepath]/[Screen]'>Preview<a/></td>
<td valign=top>[highlight]
{Or}{[dls.Title],[dc.Title],[ex.Title],Untitled}
[/highlight]{If}{[ex.Source],<br><small>([ex.Source])</small>}</td>"
---end selected portions of collect.cfg---

I still have a way to go - specifically I want to change it so the
watermarking is conrolled via the 'rights' metadata.

Any comments, bug reports and suggestions welcome.

Regards,

Stephen De Gabrielle