NAME
Catalyst::View::GD::Thumbnail - Catalyst view to resize images for thumbnails
SYNOPSIS
Create a thumbnail view:
script/myapp_create view Thumbnail Thumbnail
Then in your controller:
sub thumbnail :Local :Args(1) {
my ($self, $c, $image_file_path) = @_;
$c->stash->{x} = 100; # Create a 100px wide thumbnail
#or
$c->stash->{y} = 100; # Create a 100px tall thumbnail
$c->stash->{image} = $image_file_path;
$c->forward('View::Thumbnail');
}
DESCRIPTION
Catalyst::View::GD::Thumbnail resizes images to produce thumbnails, with options to set the desired x or y dimensions.
Options
The view is controlled by setting the following values in the stash:
- image
-
Contains the file path for the full-size source image.
This is a mandatory option.
- x
-
The width (in pixels) of the thumbnail.
This is optional, but at least one of the
x
ory
parameters must be set. - y
-
The height (in pixels) of the thumbnail.
This is optional, but at least one of the
x
ory
parameters must be set.
Image formats
The generated thumbnails will always be produced in the same format (PNG, JPG, etc) as the source image.
Catalyst::View::GD::Thumbnail uses the Image::Resize module to crop and resize images, so it accept any image format supported by Image::Resize: bmp, gif, jpeg, png, xbm, xpm.
Please see the Image::Resize documentation for more details and installation notes.
AUTHOR
Nick Logan (ugexe), <nik_517@yahoo.com>
BUGS
Please report any bugs or feature requests to bug-catalyst-view-thumbnail at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-View-GD-Thumbnail. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
COPYRIGHT & LICENSE
Copyright (C) 2010 Nick Logan (ugexe).
This module is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This module is distributed in the hope that it will be useful, but it is provided Òas isÓ and without any express or implied warranties.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 158:
Non-ASCII character seen before =encoding in 'Òas'. Assuming CP1252