package Apache::Gallery;
-# $Author: mil $ $Rev: 324 $
-# $Date: 2011-02-22 21:56:06 +0100 (Tue, 22 Feb 2011) $
+# $Author: mil $ $Rev: 335 $
+# $Date: 2011-06-08 20:47:46 +0200 (Wed, 08 Jun 2011) $
use strict;
use vars qw($VERSION);
-$VERSION = "1.0.1";
+$VERSION = "1.0.2";
BEGIN {
}
$r->headers_out->{"X-Powered-By"} = "apachegallery.dk $VERSION - Hest design!";
- $r->headers_out->{"X-Gallery-Version"} = '$Rev: 324 $ $Date: 2011-02-22 21:56:06 +0100 (Tue, 22 Feb 2011) $';
+ $r->headers_out->{"X-Gallery-Version"} = '$Rev: 335 $ $Date: 2011-06-08 20:47:46 +0200 (Wed, 08 Jun 2011) $';
my $filename = $r->filename;
$filename =~ s/\/$//;
my $fileurl = $uri."/".$file;
- if (-d $thumbfilename) {
+ # Debian bug #619625 <http://bugs.debian.org/619625>
+ if (-d $thumbfilename && ! -e $thumbfilename . ".ignore") {
my $dirtitle = '';
if (-e $thumbfilename . ".folder") {
$dirtitle = get_filecontent($thumbfilename . ".folder");
);
}
- elsif (-f $thumbfilename && $thumbfilename =~ /$doc_pattern/i && $thumbfilename !~ /$img_pattern/i) {
+ # Debian bug #619625 <http://bugs.debian.org/619625>
+ elsif (-f $thumbfilename && $thumbfilename =~ /$doc_pattern/i && $thumbfilename !~ /$img_pattern/i && ! -e $thumbfilename . ".ignore") {
my $type = lc($1);
my $stat = stat($thumbfilename);
my $size = $stat->size;
}
);
}
- elsif (-f $thumbfilename) {
+ # Debian bug #619625 <http://bugs.debian.org/619625>
+ elsif (-f $thumbfilename && ! -e $thumbfilename . ".ignore") {
my ($width, $height, $type) = imgsize($thumbfilename);
next if $type eq 'Data stream is not a known image file format';
return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
- my @neighbour_directories = grep { !/^\./ && -d "$parent_filename/$_" } readdir (PARENT_DIR);
+ # Debian bug #619625 <http://bugs.debian.org/619625>
+ my @neighbour_directories = grep { !/^\./ && -d "$parent_filename/$_" && ! -e "$parent_filename/$_" . ".ignore" } readdir (PARENT_DIR);
my $dirsortby;
if (defined($r->dir_config('GalleryDirSortBy'))) {
$dirsortby=$r->dir_config('GalleryDirSortBy');
}
if ($neightbour_counter < scalar @neighbour_directories - 1) {
my $linktext = $neighbour_directories[$neightbour_counter+1];
- if (-e $parent_filename.'/'.$neighbour_directories[$neightbour_counter-1] . ".folder") {
+ if (-e $parent_filename.'/'.$neighbour_directories[$neightbour_counter+1] . ".folder") {
$linktext = get_filecontent($parent_filename.'/'.$neighbour_directories[$neightbour_counter+1] . ".folder");
}
my %info = (
show_error($r, 500, "Unable to access directory", "Unable to access directory $path");
return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
- my @pictures = grep { /$img_pattern/i } readdir (DATADIR);
+ my @pictures = grep { /$img_pattern/i && ! -e "$path/$_" . ".ignore" } readdir (DATADIR);
closedir(DATADIR);
@pictures = gallerysort($r, @pictures);
unless ($r->dir_config('GalleryCacheDir')) {
- $cache_root = '/var/tmp/Apache-Gallery/';
+ $cache_root = '/var/cache/www/';
if ($r->server->is_virtual) {
$cache_root = File::Spec->catdir($cache_root, $r->server->server_hostname);
} else {
The options are set in the httpd.conf/.htaccess file using the syntax:
B<PerlSetVar OptionName 'value'>
-Example: B<PerlSetVar GalleryCacheDir '/var/tmp/Apache-Gallery/'>
+Example: B<PerlSetVar GalleryCacheDir '/var/cache/www/'>
=over 4
=item B<GalleryCacheDir>
Directory where Apache::Gallery should create its cache with scaled
-pictures. The default is /var/tmp/Apache-Gallery/ . Here, a directory
-for each virtualhost or location will be created automaticly. Make
-sure your webserver has write access to the CacheDir.
+pictures. The default is /var/cache/www/ . Here, a directory for each
+virtualhost or location will be created automatically. Make sure your
+webserver has write access to the CacheDir.
=item B<GalleryTemplateDir>
will be available to your templates as $EXIF_<KEYNAME> (in all uppercase).
That means that with the default setting "Picture Taken => DateTimeOriginal,
Flash => Flash" you will have the variables $EXIF_DATETIMEORIGINAL and
-$EXIF_FLASH avilable to your templates. You can place them
+$EXIF_FLASH available to your templates. You can place them
anywhere you want.
=item B<GalleryRootPath>
=back
+=over 4
+
=item B<GalleryCommentExifKey>
Set this option to e.g. ImageDescription to use this field as comments
Set this option to 1 to enable generation of a media RSS feed. This
can be used e.g. together with the PicLens plugin from http://piclens.com
+=back
+
=head1 FEATURES
=over 4
Some cameras, like the Canon G3, detects the orientation of a picture
and adds this info to the EXIF header. Apache::Gallery detects this
-and automaticly rotates images with this info.
+and automatically rotates images with this info.
If your camera does not support this, you can rotate the images
manually, This can also be used to override the rotate information
with the GalleryAutoRotate option.
To use this functionality you have to create file with the name of the
-picture you want rotated appened with ".rotate". The file should include
+picture you want rotated appended with ".rotate". The file should include
a number where these numbers are supported:
"1", rotates clockwise by 90 degree
create a file in the same directory called "Picture1234.jpg.rotate" with
the number 1 inside of it.
+=item B<Ignore directories/files>
+
+To ignore a directory or a file (of any kind, not only images) you
+create a <directory|file>.ignore file.
+
=item B<Comments>
To include comments for a directory you create a <directory>.comment
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2001-2005 Michael Legart <michael@legart.dk>
+Copyright (C) 2001-2011 Michael Legart <michael@legart.dk>
Templates designed by Thomas Kjaer <tk@lnx.dk>