Nginx::Module::Gallery - Gallery perl module for nginx. Like simple file index but thumbnail replace default icon for image.
Example of nginx http section:
http{ ... # Path to Gallery.pm perl_modules /usr/share/perl5/; perl_require Nginx/Module/Gallery.pm; }
Example of nginx server section:
server { listen 80; server_name gallery.localhost; location / { perl Nginx::Module::Gallery::handler; # Path to image files root /usr/share/images; } }
This module not for production servers! But for single user usage. Gallery don`t use nginx event machine, so one nginx worker per connect (typically 8) used for slow create thumbnails!
All thumbnails cached on first request. Next show will be more fast.
Directory index handler
Online archive response
Send image to client
Send directory index to client. Try do it like event base, but use sleep.
Send index item to client, or init send index bottom.
Sent archive file to client
Check icon for image by $path in cache and return it if exists
Get $path and $uri of image and make icon for it
Get raw thumbnail data for video file by it`s $path
Get raw thumbnail data for image file by it`s $path
Get raw thumbnail data for icon file by it`s $path
Save $icon in cache
Retrun template my $name
Return mime icon for file by $path
converts big numbers to small 1024 = 1K, 1024**2 == 1M, etc
Return unque MD5 hex string for image file by it`s $path
Return escaped $path
Return escaped uri for list of @path partitions
Get configuration variables from request $r
Make title from url
Copyright (C) 2012 Dmitry E. Oboukhov <unera@debian.org>,
Copyright (C) 2012 Roman V. Nikolaev <rshadow@rambler.ru>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program 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.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
To install Nginx::Module::Gallery, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Nginx::Module::Gallery
CPAN shell
perl -MCPAN -e shell install Nginx::Module::Gallery
For more information on module installation, please visit the detailed CPAN module installation guide.