Catalyst::View::Thumbnail is a Catalyst view to automatically generate image thumbnails.
Raw image data is placed on the stash together with options to control the size of the thumbnail. The view then uses Imager to resize the image. An example controller is shown below:
sub thumbnail :Local :Args(1) {
my ($self, $c, $filename) = @_;
$c->stash->{image} = $c->model('Images')->slurp($filename);
$c->stash->{y} = 100;
$c->forward('View::Thumbnail');
}
Source code is available on GitHub at http://github.com/jonallen/Catalyst-View-Thumbnail/tree/master
Creating thumbnail images with Catalyst - tutorial with examples of using the module.
Reference documentation is available at http://search.cpan.org/dist/Catalyst-View-Thumbnail
Jon Allen - freelance Perl & Catalyst developer, web designer, and technical manager.
Available for contract work and consultancy.
Contact jj@jonallen.info.
Follow me on Twitter at twitter.com/pennysarcade.