Package: igal
Version: 1.4-12
Severity: wishlist

Hi,

I wrote a little patch that allows you to chose the extension of the
generated files.
That is usefull if you use SSI in your template files and don't want to
fallback on the ugly X-Bit-Hack.



-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.18
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to 
C)

Versions of packages igal depends on:
ii  imagemagick   7:6.2.4.5.dfsg1-0.10~bpo.1 Image manipulation programs
ii  libimage-size 2.992-1                    determine the size of images in se
ii  liburi-perl   1.35-1                     Manipulates and accesses URI strin
ii  perl          5.8.4-8sarge5              Larry Wall's Practical Extraction 

-- no debconf information

-- 
Moritz Lenz
http://moritz.faui2k3.org/
Common subdirectories: a/debian and b/debian
diff -u a/igal b/igal
--- a/igal      2006-09-28 17:27:28.000000000 +0100
+++ b/igal      2006-09-28 17:52:33.000000000 +0100
@@ -82,9 +82,10 @@
 $opt_c = "0";          # -c to use user-supplied captions
 $opt_C = "0";          # same as -c, but preserve image names as captions
 $opt_d = ".";          # look in current directory "."
+$opt_e = ".html";      # extension of output files
 $opt_f = "0";          # -f to force thumbnail regeneration
 $opt_h = "0";
-$opt_i = "index.html"; # name of the main thumbnail index file
+$opt_i = "index$opt_e";# name of the main thumbnail index file
 $opt_k = "0";          # -k for the captions to also be used as slide titles
 $opt_n = "0";          # -n to use image file names for the .html files
 $opt_p = "3";          # cellpadding value for the thumbnail index tables
@@ -116,6 +117,7 @@
               -c          first generate and then use captions
               -C          like -c, but preserve file names as captions
               -d <dir>    operate on files in directory <dir> (.)
+              -e <ext>    extension of output file. Include the '.'.
               -f          force thumbnail regeneration and scaled slides
               -h          displays this brief help; same as --help
               -i <file>   name of the main thumbnail index file (index.html)
@@ -152,7 +154,7 @@
 @igal_options = @ARGV;
 
 # process command-line arguments (overriding defaults above)
-GetOptions('a','c','C','d=s','f','h','i=s','k','n','p=i',
+GetOptions('a','c','C','d=s', 'e=s', 'f','h','i=s','k','n','p=i',
            'r','s','t=i','u','U','w=i','x','y=i','ad','as','bigy=i',
            'con=s','help','im','www','wx=i','xy=i','clean','title=s',
            'tp=s','sp=s') or die "$usage";
@@ -191,6 +193,12 @@
                                                          && $opt_wx <= 0);
 die "Please enter a nonnegative tiled image height\n" if ($opt_t < 0);
 
+# if option -e was given, we need to adjust the name of the index file
+# unless it was given at command line
+if ($opt_i eq "index.html"){
+       $opt_i = "index$opt_e";
+}
+
 # check if the 6-digit thumbnail background color makes sense
 # die "$opt_b is not a valid hex color code\n" unless ($opt_b =~ 
m/\b(\d|[a-f]){6}\b/i);
 
@@ -454,12 +462,12 @@
        if ($opt_n) {                       # decide on the slide html file 
names
                for ($i = 0; $i < $nfiles; $i++) {
                        $temp = $imgfiles[$i];
-                       $temp =~ s/\..+?$/\.html/;
+                       $temp =~ s/\..+?$/$opt_e/;
                        push(@slides,$temp);
                }
        } else {
                for ($i = 0; $i < $nfiles; $i++) {
-                       push(@slides, $i+1 . ".html");
+                       push(@slides, $i+1 . $opt_e);
                }
        }
        system("rm -f \"$opt_d/*.html\"");
@@ -715,8 +723,10 @@
        print "\nMaking all igal files world-readable for WWW publishing...\n";
        print "chmod a+r $dir$csstemplate\n";
        system("chmod a+r $dir$csstemplate");
-       print "chmod a+r $dir*.html\n";
-       system("chmod a+r $dir*.html");
+       if (length($opt_e) > 0){
+               print "chmod a+r $dir*$opt_e\n";
+               system("chmod a+r $dir*$opt_e");
+       }
        print "chmod a+r $dir$thumbprefix*.*\n";
        system("chmod a+r $dir$thumbprefix*.*");
        print "chmod a+r $dir$slideprefix*.*\n";
diff -u a/igal.1 b/igal.1
--- a/igal.1    2006-09-28 17:27:28.000000000 +0100
+++ b/igal.1    2006-09-28 17:40:22.000000000 +0100
@@ -125,6 +125,12 @@
 which is also where the HTML and thumbnail files will be generated.
 The default is the current directory.
 .TP
+.BI -e " <ext>"
+Use 
+.IR <ext>
+as extension for output files. Defaults to 
+.BR .html 
+.TP
 .BI -f
 Force thumbnail regeneration.  Also forces medium-slide regeneration if
 .BI --bigy

Reply via email to