Johannes Ziemke > WWW-MeGa > WWW::MeGa

Download:
WWW-MeGa-0.11.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.11   Source  

NAME ^

WWW::MeGa - A MediaGallery

SYNOPSIS ^

 use WWW::MeGa;
 my $webapp = WWW::MeGa->new
 $webapp->run;

DESCRIPTION ^

THIS IS A SECURITY BUGFIX RELEASE. PLEASE UPDATE TO 0.1.1 IF YOU HAVE 0.1

WWW::MeGa is a web based media gallery. It should be run from FastCGI (see examples/gallery.fcgi) or mod_perl (not yet tested) because it uses some runtime caching.

Every file will be delievered by the CGI itself. So you don't have to care about setting up picture/thumb dirs.

To see it in action, visit: http://freigeist.org/gallery or http://sophiesfotos.de

FEATURES ^

INSTALLATION ^

Install the package

Use your favorite way to install this CPAN-Package and make sure you have ffmpeg somewhere in your path (or specify the path in the config) if you want video thumbnails.

If you want to install it via the cpan-installer use:

 cpan WWW::MeGa

To install a developer release of WWW::MeGa, use the CPAN-Shell:

 perl -MCPAN -eshell

Now you can see all releases with ls fish and install the one you want: install FISH/WWW-MeGa-0.09_6.tar.gz

WARNING: Installation via cpan or the CPAN-Shell is only recommended if you have a local administered perl installation. If you installed perl from your packet manager you should use the packet manager to install this package too. Have a look at g-cpan (Gentoo) and dh-make-perl (Debian/Ubuntu).

Use FastCGI (preferred)

Copy examples/gallery.fcgi to some dir and configure your webserver to use it as a FastCGI:

Example for lighttpd:

   fastcgi.server = (
                        "/gallery" =>
                        ( "localhost" =>
                                (
                                        "socket"        => "/var/run/lighttpd/gallery" + PID + ".socket",
                                        "check-local"   => "disable",
                                        "bin-path"      => "/var/www/gallery.fcgi"
                                )
                        ),
   )

Use CGI

Copy examples/gallery.cgi to your cgi-bin/ directory and make sure its executable. Now WWW::MeGa should have created a default config file. Change 'root' to your images and you are done.

Config

Make sure the user under which the webserver is running has write permission to the config file. The path to the config file defaults to to 'gallery.conf' in the same dir as your script. In these cases: /var/www/gallery.conf (FCGI) and /path/to/your/cgi-bin/gallery.conf.

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 WWW::MeGa.

modified gallery.fcgi

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

modified gallery.cgi

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

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.

CONFIG ^

WWW::MeGa uses 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 FindBin for more info. After the first run it will create a config containing the defaults.

Parameters

root

Path to your images

cache

Path where to store the thumbnails

album-thumb

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

thumb-type

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

video-thumbs

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

video-thumbs-offset

specifies which frame to grab in seconds. Default: 10

exif

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

ffmpeg-path

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

sizes

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

debug

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

album_thumb

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

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

icons and templates

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

METHODES ^

runmodes

the public runmodes, accessable via the rm parameter

image

shows a thumbnail

view (DEFAULT RUNMODE)

shows a html page with one or more items

FAQ ^

How do i..

..select a image a Folder-Thumbnail?

WWW::MeGa uses the image named THUMBNAIL (or whatever you setup for album_thumb in the config) in each folder as its thumbnail. So if you want to have the image foo/bar.jpg to be the thumbnail for foo, set a symlink called foo/THUMBNAIL to it (or copy it there)

..(re)create all thumbnail so that my visitors don't have to wait?

See ping-mega.pl for that.

BUGS, TODO AND NEW FEATURES ^

I tried to write a clean and elegant app but I'm not a perl guru so please bash me about everything you think suck in this project. I'm willing to learn and appreciate constructive critic.

If you think this app is cool and you like to see new features please let me know!

THANKS ^

Thanks to EXP (at least I guess he was it) who suggests me to learn perl some years ago.

And thanks alot to the people from irc.perl.org / #perlde for the current support.

COPYRIGHT ^

Code

Copyright 2008 by Johannes 'fish' Ziemke.

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

Icons

The shipped icons are copyrighted by the "Tango Desktop Project" and are licensed under the Creative Commons Attribution Share-Alike 2.5 license. See http://creativecommons.org/licenses/by-sa/2.5

Photos

biene.jpg and steine.jpg are copyrighted by Sophie Bischoff. For more, see: http://sophiesfotos.de

moewe.jpg is copyrighted by Johannes 'fish' Ziemke.

The shipped example photos are licensed unter the Creative Commons Attribution Share-Alike 3.0 license. See http://creativecommons.org/licenses/by-sa/3.0/

SEE ALSO ^

AUTHOR ^

Johannes 'fish' Ziemke <my nickname at cpan org>

syntax highlighting: