Software development manager for OpusVL [opusvl.com], member of Birmingham Perl Mongers [pm.org] and maintainer of http://perldoc.perl.org [perl.org].
Follow me on Twitter at twitter.com/JJ_Perl [twitter.com].
A couple of days ago I released Catalyst::View::Thumbnail, which provides an easy way to serve thumbnail images. It should work with any model that can put raw image data onto the stash (you don't need the MIME type, it's automatically detected), so a controller to produce thumbnails 100px high would look like this:
sub thumbnail
my ($self, $c, $filename) = @_;
$c->stash->{image} = $c->model('Images')->slurp($filename);
$c->stash->{y} = 100;
$c->forward('View::Thumbnail');
}
Have a read of the tutorial, Creating thumbnails with Catalyst, and please let me know of any fearure requests or bug reports.
The source code is on GitHub at http://github.com/jonallen/Catalyst-View-Thumbnail/tree/master, and on CPAN at http://search.cpan.org/dist/Catalyst-View-Thumbnail.
Cheers,
JJ
Easy thumbnail images from Catalyst 0 Comments More | Login | Reply /