]> git.donarmstrong.com Git - deb_pkgs/libapache-gallery-perl.git/commitdiff
Change underscores to spaces for images too (Closes: #348724)
authorDon Armstrong <don@donarmstrong.com>
Wed, 28 Sep 2011 19:35:22 +0000 (19:35 +0000)
committerDon Armstrong <don@donarmstrong.com>
Wed, 28 Sep 2011 19:35:22 +0000 (19:35 +0000)
git-svn-id: file:///srv/don_svn/deb_pkgs/libapache-gallery-perl/trunk@559 8f7917da-ec0b-0410-a553-b9b0e350d17e

Changes
README
debian/changelog
lib/Apache/Gallery.pm

diff --git a/Changes b/Changes
index f72b901a4b0d538c91cf0a6b5a1462c2db3d0b22..61946a6da13ef31eed3c300201c8398ca80752e2 100644 (file)
--- a/Changes
+++ b/Changes
@@ -3,6 +3,11 @@ $Date: 2011-02-22 21:56:06 +0100 (Tue, 22 Feb 2011) $
 
 Revision history for Perl extension Apache::Gallery.
 
+1.0.2~1 Tue Mar 15 03:08:57 CET 2011
+
+       - Extended GalleryUnderscoresToSpaces to filenames as well.
+         (Debian bug #348724, Francesco Potortì)
+
 1.0.1 Wed Feb 23 20:45:38 CET 2011
 
        - Added missing template files to MANIFEST
diff --git a/README b/README
index 14877c61045fc26d0ef9a43c04096bff6930b42e..dcbc89da496c17e31cba130425aed381e632688e 100644 (file)
--- a/README
+++ b/README
@@ -235,7 +235,8 @@ CONFIGURATION
 
     GalleryUnderscoresToSpaces
         Set this option to 1 to convert underscores to spaces in the listing
-        of directory names.
+        of directory and file names, as well as in the alt attribute for HTML
+        <img> tags.
 
     GalleryCommentExifKey
     Set this option to e.g. ImageDescription to use this field as comments
index eb556b193f337e25a4dd54cebe6ee5b6ac9d77d2..7b972dbe630a30d54b1b11e32745fe83b083fe5b 100644 (file)
@@ -1,8 +1,9 @@
-libapache-gallery-perl (1.0.1-1) UNRELEASED; urgency=low
+libapache-gallery-perl (1.0.1-1) unstable; urgency=low
 
   * New upstream release
+  * Change underscores to spaces for images too (Closes: #348724) 
 
- -- Don Armstrong <don@debian.org>  Wed, 16 Mar 2011 08:59:31 -0700
+ -- Don Armstrong <don@debian.org>  Wed, 28 Sep 2011 12:34:55 -0700
 
 libapache-gallery-perl (0.99-svn060811-1) unstable; urgency=low
 
index 646ca0e059a0625608f428851bceeb13d37dd030..8826d4a4e1ed553de2ce223f21a469e9f7c93fe4 100644 (file)
@@ -385,11 +385,16 @@ sub handler {
                                                $filetype = "unknown";
                                        }
 
+                                       # Debian bug #348724 <http://bugs.debian.org/348724>
+                                       # not images
+                                       my $filetitle = $file;
+                                       $filetitle =~ s/_/ /g if $r->dir_config('GalleryUnderscoresToSpaces');
+
                                        $tpl_vars{FILES} .=
                                             $templates{file}->fill_in(HASH => {%tpl_vars,
                                                                                FILEURL => uri_escape($fileurl, $escape_rule),
                                                                                ALT => "Size: $size Bytes",
-                                                                               FILE => $file,
+                                                                               FILE => $filetitle,
                                                                                TYPE => $type,
                                                                                FILETYPE => $filetype,
                                                                               }
@@ -408,8 +413,14 @@ sub handler {
                                        my $cached = get_scaled_picture_name($thumbfilename, $thumbnailwidth, $thumbnailheight);
 
                                        my $rotate = readfile_getnum($r, $imageinfo, $thumbfilename.".rotate");
+
+                                       # Debian bug #348724 <http://bugs.debian.org/348724>
+                                       # HTML <img> tag, alt attribute
+                                       my $filetitle = $file;
+                                       $filetitle =~ s/_/ /g if $r->dir_config('GalleryUnderscoresToSpaces');
+
                                        my %file_vars = (FILEURL => uri_escape($fileurl, $escape_rule),
-                                                        FILE    => $file,
+                                                        FILE    => $filetitle,
                                                         DATE    => $imageinfo->{DateTimeOriginal} ? $imageinfo->{DateTimeOriginal} : '', # should this really be a stat of the file instead of ''?
                                                         SRC     => uri_escape($uri."/.cache/$cached", $escape_rule),
                                                         HEIGHT => (grep($rotate==$_, (1, 3)) ? $thumbnailwidth : $thumbnailheight),
@@ -1897,7 +1908,8 @@ Quality at 50:
 =item B<GalleryUnderscoresToSpaces>
 
 Set this option to 1 to convert underscores to spaces in the listing
-of directory names.
+of directory and file names, as well as in the alt attribute for HTML
+<img> tags.
 
 =back