in reply to Re: Creating thumbnail solution help
in thread Creating thumbnail solution help
Here is an image: http://img707.imageshack.us/img707/2011/picture066q.jpg
The code im using is
It can also be seen on the author's site here: http://perl.jonallen.info/writing/articles/creating-thumbnails-with-catalyst It opens the file using Catalyst::Model::File. I don't see any parameters to set it to binary, so maybe that is why. But the tutorial on the author's page above doesn't mention anything about having to set the file model to binary so I dunno...sub thumbnail :Regex('^thumbnail/(.+)') { my ($self, $c) = @_; my $image_id = $c->req->captures->[0]; $image_id =~ s/\//\\/g; my $image_obj = $c->model('File')->slurp($image_id) or $c->detach('/default'); $c->stash->{scaling} = 'fit'; $c->stash->{x} = 100; $c->stash->{image} = $image_obj; $c->forward('View::Thumbnail'); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Creating thumbnail solution help
by uG (Scribe) on Mar 06, 2010 at 03:12 UTC |
In Section
Seekers of Perl Wisdom