Mojolicious::Plugin::Thumbnail - Mojolicious Plugin
# Mojolicious $self->plugin('Thumbnail'); # Mojolicious::Lite plugin 'Thumbnail'; # limit width, auto height $self->thumbnail( src => 'public/img/img.jpg', dst => 'public/img/img_thumb.jpg', width => 150, ); # limit height, auto width $self->thumbnail( src => 'public/img/img.jpg', dst => 'public/img/img_thumb.jpg', width => 150, ); # Resize and crop $self->thumbnail( src => 'public/img/img.jpg', dst => 'public/img/img_thumb.jpg', width => 150, height => 150 );
Mojolicious::Plugin::Thumbnail is a simple plugin for fast creating thumbnails using Imager.
Mojolicious::Plugin::Thumbnail inherits all methods from Mojolicious::Plugin and implements the following new ones.
Supported parameters:
src – Source image path
src
dst – Destination image path (default: /path/to/sourcefilename_thumb.ext)
dst
width – The new width of the image
width
height – The new height of the image
height
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
To install Mojolicious::Plugin::Thumbnail, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::Thumbnail
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::Thumbnail
For more information on module installation, please visit the detailed CPAN module installation guide.