Plugins You can find out about all the publicly available Grails plugins.

Website Preview Images

  • Tags: /
  • Latest: 0.1
  • Last Updated: 20 July 2009
  • Grails version: 1.1 > *
  • Authors: null
0 vote
compile "org.grails.plugins:webthumbs:0.1"




grails install-plugin webthumbs


Webthumbs plugin

Take care, it's early days for this plugin. The signed URL that the plugin generates includes a dateString which needs to be in the UTC time zone. If this is not the case, the signed URLs will be invalid. Having a UTC offset configuration property and a little tag library is on my list but I got little time right now.

The webthumbs plugin generates signed URLs for the webthumbs service. You will first have to sign up to be able to use this plugin. You will get 100 free credits per month which makes it easy to try it out for free.


To install the webthumbs plug-in just run the following command

grails install-plugin webthumbs

After signing up at, add your key and user properties to the Config.groovy file, like this:

webthumbs.key = 'key'
webthumbs.user = 'user'


The plugin installs the WebthumbService and a small example controller that uses this service to create a preview URL to You should be able to call this demo controller with a URL like this:


This is what the controller looks like:

class WebthumbsController {

def webthumbsService

def index = { render webthumbsService.getThumbURL('') } }

Be warned that it is a bad idea to expose a general purpose action which takes the URL to preview as an input parameter. You would be exposing a free preview service if others find out. This demo controller does not do any harm as it would just create signed preview URLs for a single URL, the groovytweets website.

The webthumbsService.getThumbURL() method can be called with up to three parameters. By default the size will be set to medium2 and cache to 1. Cache specifies the number of days the preview image may be old (this makes sense as each preview request takes a few second to create the preview if the image has not been generated yet). The default size medium2 will return a preview image URL for a 320x240px image. A detailed description can be found at the Easythumbs API documentation.

A couple more examples:

{script} //preview URL for, 320x240 image size, image may be 1 day old (default) def url = webthumbService.getThumbURL("", "medium2")

//preview URL for, 160x120 image size, image may be 5 days old url = webthumbService.getThumbURL("", "medium", 5) {script}


  • support for date offset so servers not in UTC can generate valid preview URLs all the time
  • a basic tag library that takes a normal URL and outputs a signed preview URL