NAME

Catalyst::Plugin::Upload::Image::Magick::Thumbnail - Making thumbnail image is kept ratio, resized to specified size or less.

VERSION

Version 0.01

SYNOPSIS

In your Catalyst project,

use Catalyst qw/Upload::Image::Magick::Thumbnail/;

You can execute "thumbnail" method in Catalyst::Request::Upload object

sub resize_to: Local {
  my ($self, $c) = @_;

  my $upload = $c->request->upload('file_field');
  my $thumbnail = $upload->thumbnail({
    density => '60x70',
    format => 'png',
    quality => 100
  });

  # $thumbnail is Image::Magick object
  my ($width, $height) = $thumbnail->Get('width', 'height');

  # ...
}

DESCRIPTION

This module is almost same usage Image::Magick::Thumbnail. But I tried it, I was not able to be satisfied with the result.

In making thumbnail image, it usually is most important that thumbnail should be stored in the specified size or less. But Image::Magick::Thumbnail module is wrong about this.

In making thumbnail made by this module, it is made to approach the specified size unlimitedly and kept original ratio.

METHODS

thumbnail($args)

Create thumbnail image.

$args

$args is hash reference. Please see below arguments detail.

density

String formatted width x height. See below example format.

"80x60"
size

Number format similared density option. The mean if size option value is 60, equal to density option "60x60". Priority of density option is higher than size option.

format

String of image format. You can choose one of gif, jpg or png. Default value is jpg.

quality

Image quality option. highest value is 100. minimam value is 0. default 70.

gravity

Optional parameter. Default center. See Image::Magick::Thumbnail::Fixed.

compose

Optional parameter. Default over. See Image::Magick::Thumbnail::Fixed.

bgcolor

Optional parameter. Default white. See Image::Magick::Thumbnail::Fixed.

See also Image::Magick::Thumbnail, Image::Magick::Thumbnail::Fixed

AUTHOR

Toru Yamaguchi, <zigorou at cpan.org>

SEE ALSO

BUGS

Please report any bugs or feature requests to bug-catalyst-plugin-upload-image-magick-thumbnail at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-Plugin-Upload-Image-Magick. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Catalyst::Plugin::Upload::Image::Magick

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2006 Toru Yamaguchi, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.