Thursday, November 05, 2009

Thumbnails and JoomGallery

so, with JoomGallery working well, i now need a way to create multiple thumbnails.

JoomGallery automatically creates one thumbnail on upload; i want to intercept that and create 3.

So, there are a couple of ways of doing that;

  • amend the JoomGallery code and add the extra code

  • amend the JoomGallery code to trigger and event and write a plugin to create the thumbnails



The latter is more appealing; we can control/maintain the image sizes by adding parameters to the Plugin and then use those in the code.

Update: Part One
added this to classes/upload.class.php:


$dispatcher =& JDispatcher::getInstance();
//$results = $dispatcher->trigger('onJoomCreateThumbnail', $params);


So, need to populate 'params' and the write the plugin to handle it. Beauty is we can re-use JoomGallery's functionality to create the thumbnails for us.

No comments: