WWW::MeGa::Item - Representing a item in WWW::MeGa
use WWW::MeGa::Item; my $item = WWW::MeGa::Item->new('some/file.jpg', $config, $cache); print $item->thumbnail(1);
WWW::MeGa::Item represents a "item" in WWW::MeGa.
Passing a relative path to a arbitrary file to the new-method will return one of the following specific objects based on the mime type:
WWW::MeGa::Item::Audio
WWW::MeGa::Item::Folder - represents an album
WWW::MeGa::Item::Image
WWW::MeGa::Item::Other - represents an item for which no specific object was found
WWW::MeGa::Item::Text
WWW::MeGa::Item::Video
creates a new WWW::MeGa::Item::* object based on the mime type of the file specified by $relative_path.
$config is a Config::Simple object, containing, amongst other things, the root-path to build the absolute path.
$cache is a hash reference to cache the exif data
returns necessary data for rendering the template
read, return and cache the exif data for the represented file
reads $self-thumbnail_source> and returns a thumbnail in the requested size. If $self-thumbnail_source> does not exist, it use a icon based on the mime type.
$self-
It should not be called directly but through the caching methode $self-thumbnail>.
returns the source for the thumbnail. Thats the original file that can be scaled via thumbnail_sized. Think of it as a image represenation for the file type. This method is empty and should be overwritten for images and videos to have a real thumbnail.
returns the actual thumbnail. If the resized thumb already exist, return the path to that one. If no, try to create it first by calling $self-thumbnail_sized>
To install WWW::MeGa, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::MeGa
CPAN shell
perl -MCPAN -e shell install WWW::MeGa
For more information on module installation, please visit the detailed CPAN module installation guide.