CGI-Application-Plugin-Thumbnail

 view release on metacpan or  search on metacpan

lib/CGI/Application/Plugin/Thumbnail.pod  view on Meta::CPAN




=head1 PARAMS TO CONSTRUCTOR

   new My::Cgiapp(
      PARAMS => {       
         thumbnail_rel_dir => '.thumbnails',                  
         thumbnail_restriction => '100x100',
      },   
   );


You do not have to provide parameters. Defaults are provided.

=head2 WHAT PICTURE?

What you tell the runmode thumbnail is not what thumbnail you want, but what original picture you want a thumbnail *of*.

The way you tell it is via the query string, if you want a thumbnail of /home/me/public_html/img/one.jpg, then the query 
string would read one of these:

   ?rm=thumbnail&rel_path=img/one.jpg
   ?rm=thumbnail&rel_path=/img/one.jpg

=head2 THUMBNAIL DOCROOT

You can define where the thumbnails are stored via parameter to constructor.
We attempt to create if not there.

   new My::Cgiapp(
      PARAMS => { 
         thumbnail_rel_dir => '/.thumbnails' },
   );

Default is shown above.

=head2 THUMBNAIL RESTRICTION, DIMENSIONS

We define dimensions as maximum width and maximum height.
If you do not define dimensions, default is 100x100.
You may also defined dimmensions via the query string:

   ?rm=thumbnail&rel_path=img/one.jpg&thumbnail_restriction=100x100

We store thumbs by dimension for example these are requests and their destinations
Keep in mind that if the thumbnail dimensions are larger then the image, no thumbnail is made, 
the original is streamed back.

   ?rm=thumbnail&rel_path=img/one.jpg
   DOCUMENT_ROOT/.thumbnails/100x100/img/one.jpg
   
   ?rm=thumbnail&rel_path=img/one.jpg&thumbnail_restriction=100x100
   DOCUMENT_ROOT/.thumbnails/100x100/img/one.jpg

   ?rm=thumbnail&rel_path=img/one.jpg&thumbnail_restriction=600x600
   DOCUMENT_ROOT/.thumbnails/600x600/img/one.jpg

=head1 CHANGES

Since version 1.03, instead of using Image::Magick::Thumbnail, we use Image::Thumbnail.
You must have GD, Image::Magick, or Imager installed.
Requested by Lyle.

For more changes, see the 'Changes' file included in this distribution.

=head1 REVISION

$Revision: 1.1 $

=head1 CAVEATS & BUGS

Still a work in progress.
If you want any changes in this module, please contact the AUTHOR.
  
=head1 AUTHOR

Leo Charre leocharre at cpan dot org

=head1 COPYRIGHT

Copyright (c) 2009 Leo Charre. All rights reserved.

=head1 LICENSE

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e., under the terms of the "Artistic License" or the "GNU General Public License".

=head1 DISCLAIMER

This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the "GNU General Public License" for more details.

=cut



( run in 1.645 second using v1.01-cache-2.11-cpan-39bf76dae61 )