Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jj (2990)

  (email not shown publicly)

Software development manager for OpusVL [], member of Birmingham Perl Mongers [] and maintainer of [].

Follow me on Twitter at [].

Journal of jj (2990)

Wednesday September 09, 2009
06:54 AM

Easy thumbnail images from Catalyst

[ #39600 ]

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 :Local :Args(1) {
   my ($self, $c, $filename) = @_;

   $c->stash->{image} = $c->model('Images')->slurp($filename);
   $c->stash->{y}     = 100;


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, and on CPAN at



The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.