WWW-MeGa

 view release on metacpan or  search on metacpan

lib/WWW/MeGa.pm  view on Meta::CPAN

You can (and should, at least in the CGI case) specify a custom path to
the config by changing the scripts to pass:

 PARAMS => { config => '/path/to/your/config' }

to the new method of L<WWW::MeGa>.

=head4 modified gallery.fcgi

 ...
 my $app = WWW::MeGa->new
 (
         QUERY => $q,
         PARAMS => { cache => \%cache, config => '/path/to/your/config' },
 );
 ...

=head4 modified gallery.cgi

 ...
 my $webapp = WWW::MeGa->new(PARAMS => {config => '/path/to/your/config'});
 ...

=head2 Test it

Now visit the the URL to you script. (In these examples:
http://example.com/gallery (FastCGI) and
http://example.com/cgi-bin/gallery.cgi (CGI)) and you
should see the example photos. 

=head1 CONFIG

L<WWW::MeGa> uses L<CGI::Application::Plugin::Config::Simple> for config handling.
You can specify the path to a (writable) config file in the new methode of WWW::MeGa:

   my $gallery = WWW::MeGa->new(PARAMS => { config => '/path/to/gallery.conf' })

It defaults to $RealBin/gallery.conf, see L<FindBin> for more info.
After the first run it will create a config containing the defaults.


=head2 Parameters

=head3 root

Path to your images


=head3 cache

Path where to store the thumbnails

=head3 album-thumb

specifies which file should be used a thumbnail for a folder. Defaults to C<THUMBNAIL>.
The file named like that will be skipped when showing the content of the folder.

=head3 thumb-type

Type of the thumbnails.
L<WWW::MeGa> uses L<Image::Magick> for generating thumbnails.
See C<convert -list format> for file types supported by you ImageMagick
installation.

=head3 video-thumbs

If set to 1, enables video-thumbs. Default: 1

=head3 video-thumbs-offset

specifies which frame to grab in seconds. Default: 10

=head3 exif

If set to 1, enables the extraction of exif-data. Default: 1

=head3 ffmpeg-path

Specify the path to the ffmpeg-binary. Defaults to 'ffmpeg'. (Should be
looked up in your PATH)

=head3 sizes

A array of valid "thumbnail"/resized image sizes, defaults to
C<[ 120, 600, 800 ]>.
The CGI parameter C<size> is the index to that array.


=head3 debug

If set to 1, enabled debugging to your server's error log.


=head3 album_thumb

Specify the name of the image which will be used as a thumbnail for the
containing album, defaults to C<THUMBNAIL>.

So if you want to have the image C<foo.jpg> be the thumbnail for the album C<bar>, copy it to C<bar/THUMBNAIL> (or use a symlink)


=head3 icons and templates

Path to the icons and templates, defaults to C<icons/> in the module's share dir as defined by L<Module::Install> and L<File::ShareDir>


=head1 METHODES

=cut

use CGI::Application;
use File::Spec::Functions qw(splitdir catdir no_upwards);
use Scalar::Util;
use File::ShareDir;
use FindBin qw($RealBin);

use base ("CGI::Application::Plugin::HTCompiled", "CGI::Application");

use CGI::Application::Plugin::Config::Simple;
use CGI::Application::Plugin::Stream (qw/stream_file/);



( run in 0.709 second using v1.01-cache-2.11-cpan-5a3173703d6 )