view release on metacpan or search on metacpan
$Date: 2011-06-08 20:47:46 +0200 (Wed, 08 Jun 2011) $
Revision history for Perl extension Apache::Gallery.
1.0.2 Wed Jun 8 20:47:16 CEST 2011
- Extended GalleryUnderscoresToSpaces to filenames as well.
(Debian bug #348724, Francesco Potortì)
- Added txt to GalleryDocFile, the code in Gallery.pm already
allowed it. (Luca Capello)
- Added text-html.png and text-txt.png icons.
(Debian bug #423004, Luca Capello)
- Fixed counter typo for <directory>.folder in next directory
menu item. (Luca Capello)
- Added support to ignore items through <directory|file>.ignore.
(Debian bug #619625, Luca Capello)
- Fixed spelling typos in Gallery.pm and README. (Luca Capello)
- GalleryCacheDir defaults to /var/cache/www/ per the FHS-2.3.
(Debian bug #337197, Luca Capello)
- Fixed two minor POD errors (Michael Legart)
is not running from the root of the virtual host (Lubomir Host)
- Report proper errors when there are problems with templates (Don Armstrong)
- Support newest mod_perl2 version (Philip Paeps)
0.9.1 Sat Sep 11 23:52:16 CEST 2004
- Fix mod_perl 1 support that was broken with 0.9 (Michael Legart)
0.9 Sat Sep 11 22:03:20 CEST 2004
- Handle .thm for all filetypes and not just tiff, gif and png
(Michael Legart)
- Make GallerySortBy work for directories (Michael Legart)
- Make GalleryDirSortBy override GallerySortBy for directories
(Andreas Plesner)
- Report 404 for HEAD requests to non-existing files or directories
(Michael Legart)
- Scale images when they are requested from the cache instead of
before the index is displayed. (Michael Legart)
- Sort pictures the same way when viewing images as when viewing
directories (Andreas Plesner)
GalleryImgFile that makes it possible to configured which
filetypes should be displayed. See the documentation for
details. (Guillaume Rousse)
- Added new option GalleryThumbnailSizeLS. If set to 1,
GalleryThumbnailSize is the long and the short side
of the thumbnail image instead of the width and height.
(Don Armstrong)
- Switched to use Text::Template instead of CGI::FastTemplate,
see the UPGRADE file for details. (Don Armstrong)
- Create copyright notices on pictures using truetype fonts
instead of png images. Font, color and size can be configured
(Thomas Petersen, Michael Legart)
0.7 Mon Sep 8 22:30:35 CEST 2003
- Support mod_perl version 1 and 2 (1.99) (Michael Legart)
- Send status code 500 on errors, 404 on file not found and
make IE show our own errorpage. (Thomas L. Kjeldsen)
- Bugfix for directories named "0" (Andreas Plesner Jacobsen)
- Added "selection mode". Select images with checkboxes and
get a list of filenames. (Peter Andreasen)
<VirtualHost *>
ServerName gallery.yourdomain.org
DocumentRoot /data/pictures/
ErrorLog logs/gallery-error_log
TransferLog logs/gallery-access_log
PerlSetVar GalleryTemplateDir '/usr/local/apache/gallery/templates/default/'
PerlSetVar GalleryInfo 'Picture Taken => DateTimeOriginal, Flash => Flash'
PerlSetVar GallerySizes '640 1024 1600 2272'
PerlSetVar GalleryThumbnailSize '100x75'
PerlSetVar GalleryCopyrightImage 'htdocs/c.png'
<Location />
SetHandler perl-script
PerlHandler Apache::Gallery
</Location>
</VirtualHost>
In case you run apache 2 and modperl 2 (or 1.99), it needs to look
like:
<VirtualHost *>
ServerName gallery.yourdomain.org
DocumentRoot /data/pictures/
ErrorLog logs/gallery-error_log
TransferLog logs/gallery-access_log
PerlSetVar GalleryTemplateDir '/usr/local/apache/gallery/templates/default/'
PerlSetVar GalleryInfo 'Picture Taken => DateTimeOriginal, Flash => Flash'
PerlSetVar GallerySizes '640 1024 1600 2272'
PerlSetVar GalleryThumbnailSize '100x75'
PerlSetVar GalleryCopyrightImage 'htdocs/c.png'
PerlOptions +GlobalRequest
<Location />
SetHandler modperl
PerlResponseHandler Apache::Gallery
</Location>
</VirtualHost>
Warning: Apache::Gallery does not work properly if mod_autoindex
is loaded by Apache. Indeed, mod_autoindex overrides Apache::Gallery
and does not let it display directory content.
LoadModule autoindex_module /usr/lib/apache/1.3/mod_autoindex.so
If this line is not commented, Apache::Gallery will only work when an
image is loaded directly. Whenever a directory listing is requested,
Apache will respond with the classic (and ugly) directory listing performed
by mod_autoindex.
Copy the files from templates/ to where you pointed GalleryTemplateDir to.
Create a directory called gallery in your Apache icons directory and
copy the png files in htdocs to this directory.
The gallery.css file from the template directory you choose must be
copied to the DocumentRoot of your gallery.
It is possible to include a graphical copyright notice on each picture now.
By setting the GalleryCopyrightImage PerlSetVar you can define the path
to a picture that you want include in the bottom right of each picture.
Feel free to contact me with questions if you have problems setting up
Apache::Gallery. You can write to michael@legart.dk
Changes
htdocs/agfolder.png
htdocs/application-doc.png
htdocs/application-pdf.png
htdocs/application-rtf.png
htdocs/c.png
htdocs/sound-mp3.png
htdocs/sound-ogg.png
htdocs/sound-wav.png
htdocs/video-asf.png
htdocs/video-avi.png
htdocs/video-mov.png
htdocs/video-mpeg.png
htdocs/video-mpg.png
htdocs/video-wmv.png
INSTALL
lib/Apache/Gallery.pm
LICENSE
Makefile.PL
MANIFEST
META.yml
README
t/001_use.t
t/002_graphlibs.t
t/002_injpg.jpg
t/002_inpng.png
t/003_comment.t
t/003_commenttest
t/004_cache_dir.t
t/005_imageinfo.t
t/005_jpg.jpg
t/006_thumbnails.t
t/007_pod.t
templates/bright/dircomment.tpl
templates/bright/directory.tpl
templates/bright/error.tpl
Defaults to '100x75'
GalleryThumbnailSizeLS
If set to '1', GalleryThumbnailSize is the long and the short side
of the thumbnail image instead of the width and height.
Defaults to '0'.
GalleryCopyrightImage
Image you want to blend into your images in the lower right corner.
This could be a transparent png saying "copyright my name 2001".
Optional.
GalleryWrapNavigation
Make the navigation in the picture view wrap around (So Next at the
end displays the first picture, etc.)
Set to 1 or 0, default is 0
GalleryAllowOriginal
default is "root:"
GalleryMaxThumbnailsPerPage
This options controls how many thumbnails should be displayed in a
page. It requires $BROWSELINKS to be in the index.tpl template file.
GalleryImgFile
Pattern matching the files you want Apache::Gallery to view in the
index as thumbnails.
The default is '\.(jpe?g|png|tiff?|ppm)$'
GalleryDocFile
Pattern matching the files you want Apache::Gallery to view in the
index as normal files. All other filetypes will still be served by
Apache::Gallery but are not visible in the index.
The default is
'\.(mpe?g|avi|mov|asf|wmv|doc|mp3|ogg|pdf|rtf|wav|dlt|txt|html?|csv|
eps)$'
The background-color of a GalleryCopyrightText
r,g,b,a - for examples, see GalleryCopyrightColor
GalleryQuality
The quality (1-100) of scaled images
This setting affects the quality of the scaled images. Set this to a
low number to reduce the size of the scaled images. Remember to
clear out your cache if you change this setting. Quality seems to
default to 75, at least in the jpeg and png loader code in Imlib2
1.1.0.
Examples:
Quality at 50: PerlSetVar GalleryQuality '50'
GalleryUnderscoresToSpaces
Set this option to 1 to convert underscores to spaces in the listing
of directory and file names, as well as in the alt attribute for
HTML <img> tags.
If you are using mod_perl2 version mod_perl-2.0 is now required.
Also, CGI 3.08 is required if using mod_perl2.
To enable access keys for navigation update the navpicture.tpl and
showpicture.tpl templates.
For users upgrading from 0.7 to 0.8
You need to create new directory called gallery in Apaches
icons directory. Copy the png files from the htdocs dictory
to this new directory.
For those of you with pre-existing templates, a simple
cd templates; perl -pi -e 's/(?<!\\)(\$[\w\_\d]+)/\{ $1 \}/g' *.tpl
should get your templates but directory.tpl and file.tpl
working correctly. The last two needs to be updated from
the distribution.
For users upgrading from 0.6 to 0.7
Apache::Gallery now uses the module Image::Imlib2 instead
of Inline::C. This enables us to ship binary distributions.
Copy htdocs/agfolder.png to your Apache
icons directory.
If you enable the GalleryMaxThumbnailsPerPage option you
need to update your index.tpl template file or use the
new templates. You also need to copy templates/default/gallery.css
to your DocumentRoot.
To update to the new layout, copy templates/new/gallery.css
to your DocumentRoot and copy templates/new/*.tpl to your
GalleryTemplateDir and set the following option in your virtual
PerlSetVar GalleryEXIFMode 'values'
For users upgrading from 0.5.1 to 0.6
templates/movie.tpl has been removed and replaced by
templates/file.tpl
Remember to update templates/picture.tpl
htdocs/video-wmv.png
htdocs/application-doc.png
htdocs/application-mp3.png
htdocs/application-ogg.png
htdocs/application-pdf.png
htdocs/application-rtf.png
htdocs/application-wav.png
have been added and should be copied to our Apache icons
directory.
For users upgrading from 0.5 to 0.5.1
InlineDir is no longer honored, File::Spec is used to find a temporary
directory (usually /tmp)
Since 0.5, your .cache subdirectories are no longer used and can be
safely deleted. All cached images are now kept in
PerlSetVar GalleryCacheDir '/var/tmp/Apache-Gallery/'
GalleryCacheDir is optional but you can use it to decide
where Apache::Gallery should place the scaled pictures.
For users upgrading from 0.3 to 0.4:
Two new options have been added, they are both optional:
PerlSetVar GalleryThumbnailSize '100x75'
PerlSetVar GalleryCopyrightImage 'htdocs/c.png'
The templates and the htdocs/gallery.css file has been updated
so remember to copy them to your template dir and documentroot!
To use the new movie feature make sure you add the movie.tpl file
to your templates dir and copy the video-* files from htdocs to
your apache icons directory.
For users upgrading from 0.2 to 0.3:
lib/Apache/Gallery.pm view on Meta::CPAN
show_error($r, 404, "404!", "No such file or directory: ".uri_escape($r->uri, $escape_rule));
return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
my $doc_pattern = $r->dir_config('GalleryDocFile');
unless ($doc_pattern) {
$doc_pattern = '\.(mpe?g|avi|mov|asf|wmv|doc|mp3|ogg|pdf|rtf|wav|dlt|txt|html?|csv|eps)$'
}
my $img_pattern = $r->dir_config('GalleryImgFile');
unless ($img_pattern) {
$img_pattern = '\.(jpe?g|png|tiff?|ppm)$'
}
# Let Apache serve files we don't know how to handle anyway
if (-f $filename && $filename !~ m/$img_pattern/i) {
return $::MP2 ? Apache2::Const::DECLINED() : Apache::Constants::DECLINED();
}
if (-d $filename) {
unless (-d cache_dir($r, 0)) {
lib/Apache/Gallery.pm view on Meta::CPAN
=item B<GalleryThumbnailSizeLS>
If set to '1', B<GalleryThumbnailSize> is the long and the short side of
the thumbnail image instead of the width and height.
Defaults to '0'.
=item B<GalleryCopyrightImage>
Image you want to blend into your images in the lower right
corner. This could be a transparent png saying "copyright
my name 2001".
Optional.
=item B<GalleryWrapNavigation>
Make the navigation in the picture view wrap around (So Next
at the end displays the first picture, etc.)
Set to 1 or 0, default is 0
lib/Apache/Gallery.pm view on Meta::CPAN
=item B<GalleryMaxThumbnailsPerPage>
This options controls how many thumbnails should be displayed in a
page. It requires $BROWSELINKS to be in the index.tpl template file.
=item B<GalleryImgFile>
Pattern matching the files you want Apache::Gallery to view in the
index as thumbnails.
The default is '\.(jpe?g|png|tiff?|ppm)$'
=item B<GalleryDocFile>
Pattern matching the files you want Apache::Gallery to view in the index
as normal files. All other filetypes will still be served by Apache::Gallery
but are not visible in the index.
The default is '\.(mpe?g|avi|mov|asf|wmv|doc|mp3|ogg|pdf|rtf|wav|dlt|txt|html?|csv|eps)$'
=item B<GalleryTTFDir>
lib/Apache/Gallery.pm view on Meta::CPAN
r,g,b,a - for examples, see GalleryCopyrightColor
=item B<GalleryQuality>
The quality (1-100) of scaled images
This setting affects the quality of the scaled images.
Set this to a low number to reduce the size of the scaled images.
Remember to clear out your cache if you change this setting.
Quality seems to default to 75, at least in the jpeg and png loader code in
Imlib2 1.1.0.
Examples:
Quality at 50:
PerlSetVar GalleryQuality '50'
=item B<GalleryUnderscoresToSpaces>
Set this option to 1 to convert underscores to spaces in the listing
t/002_graphlibs.t view on Meta::CPAN
eval { require Apache::FakeRequest; };
if ($@) {
plan skip_all => 'skip Apache::FakeRequest not found';
}
else {
plan tests => 4;
my $request = Apache::FakeRequest->new('get_remote_host' => 'localhost');
Apache::Gallery::resizepicture($request, 't/002_inpng.png', 't/inpng-resized.png', 10, 10, 0, '');
Apache::Gallery::resizepicture($request, 't/002_injpg.jpg', 't/injpg-resized.jpg', 10, 10, 0, '');
my ($pngwidth, $pngheight)=imgsize('t/inpng-resized.png');
my ($jpgwidth, $jpgheight)=imgsize('t/injpg-resized.jpg');
is ($pngwidth, 10, 'PNG Width') or diag('You need to install libpng before libimlib');
is ($pngheight, 10, 'PNG Height') or diag('You need to install libpng before libimlib');
is ($jpgwidth, 10, 'JPG Width') or diag('You need to install libjpeg before libimlib');
is ($jpgheight, 10, 'JPG Height') or diag('You need to install libjpeg before libimlib');
unlink('t/inpng-resized.png');
unlink('t/injpg-resized.jpg');
}
templates/bright/directory.tpl view on Meta::CPAN
<div class="folder"><a href="{ $FILEURL }/"><img src="/icons/gallery/agfolder.png" alt="* { $FILE }" /><br />{ $FILE }</a></div>
templates/bright/file.tpl view on Meta::CPAN
<div class="folder"><a href="{ $FILEURL }"><img border="0" alt="{ $ALT }" src="/icons/gallery/{ $FILETYPE }.png " /><br />{ $FILE }</a></div>
templates/default/directory.tpl view on Meta::CPAN
<div id="folder"><a href="{ $FILEURL }/"><img border="0" src="/icons/gallery/agfolder.png"><br>{ $FILE }</a></div>
templates/default/file.tpl view on Meta::CPAN
<div id="folder"><a href="{ $FILEURL }"><img border="0" alt="{ $ALT }" src="/icons/gallery/{ $FILETYPE }.png" /><br />{ $FILE }</a></div>
templates/new/directory.tpl view on Meta::CPAN
<div class="folder"><a href="{ $FILEURL }/"><img src="/icons/gallery/agfolder.png" alt="* { $FILE }"><br>{ $FILE }</a></div>
templates/new/file.tpl view on Meta::CPAN
<div class="folder"><a href="{ $FILEURL }"><img border="0" alt="{ $ALT }" src="/icons/gallery/{ $FILETYPE }.png " /><br />{ $FILE }</a></div>