Mail Index


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ApacheGallery] pot@xxxxxxxxxx: Bug#348724: patch: GalleryUnderscoresToSpaces for file names



A patch sent to the debian BTS, if it is interesting...

----- Forwarded message from Francesco Potorti` <pot@xxxxxxxxxx> -----

Subject: Bug#348724: libapache-gallery-perl: patch: GalleryUnderscoresToSpaces for file names
From: Francesco Potorti` <pot@xxxxxxxxxx>
To: Debian Bug Tracking System <submit@xxxxxxxxxxxxxxx>
Message-Id: <E1EzGO7-00022F-00@xxxxxxxxxxxxxxx>
Date: Wed, 18 Jan 2006 17:42:23 +0100

Package: libapache-gallery-perl
Version: 0.99-svn050921-1
Severity: wishlist

This wonderful patch does what I have wanted for some time: when
GalleryUnderscoresToSpaces is set, it works for file names too, rather
than for dir names only.  The patch works for me, but does not include
the required changes to the docs in Gallery.pm. the man page and the
README.

--- Gallery.pm.orig	2005-09-16 10:52:59.000000000 +0200
+++ Gallery.pm.pot	2006-01-18 17:32:00.000000000 +0100
@@ -354,11 +354,13 @@ sub handler {
 						$filetype = "unknown";
 					}
 
+					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,
 									       }
@@ -377,8 +379,10 @@ sub handler {
 					my $cached = get_scaled_picture_name($thumbfilename, $thumbnailwidth, $thumbnailheight);
 
 					my $rotate = readfile_getnum($r, $imageinfo, $thumbfilename.".rotate");
+					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),


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'testing-proposed-updates')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.4.30-pre2-pr-hrt-1kHz-1
Locale: LANG=C, LC_CTYPE=it_IT@euro (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)

Versions of packages libapache-gallery-perl depends on:
ii  libapache-request-perl        1.33-1     Generic Apache Request Library
ii  libimage-imlib2-perl          1.07-1     perl interface to the imlib2 imagi
ii  libimage-info-perl            1.16-2     allows extraction of meta informat
ii  libimage-size-perl            2.992-2    determine the size of images in se
ii  libtemplate-perl              2.14-1     template processing system written
ii  libtext-template-perl         1.44-1.1   Text::Template perl module
ii  perl                          5.8.7-10   Larry Wall's Practical Extraction 

libapache-gallery-perl recommends no packages.

-- no debconf information

----- End forwarded message -----

-- 
Jesus Climent                                      info:www.pumuki.org
Unix SysAdm|Linux User #66350|Debian Developer|2.6.15|Helsinki Finland
GPG: 1024D/86946D69 BB64 2339 1CAA 7064 E429  7E18 66FC 1D7F 8694 6D69

Sticking feathers up your butt does not make you a chicken.
		--Tyles Durden (Fight club)
_______________________________________________
users mailing list
users@xxxxxxxxxxxxxxxx
http://ufo.hestdesign.com/cgi-bin/mailman/listinfo/agusers