igal2-2.2/0000755000175000017500000000000012723742151007652 5ustar wtigal2-2.2/indextemplate2.html0000644000175000017500000000235411110104720013450 0ustar wt Index of Pictures Further directories:
Index of Pictures / ..

created with igal2

igal2-2.2/directoryline2.html0000644000175000017500000000007711110104720013461 0ustar wt
  • #DIRECTORY#
  • igal2-2.2/slidetemplate2.html0000644000175000017500000000346011760751422013462 0ustar wt <!--SLIDE-TITLE--> > >

    Index       ><< Prev    >Next >>

    Index    ><< Prev  >Next >>

    igal2-2.2/igal2.pl0000777000175000017500000000000011110233733012111 2igal2ustar wtigal2-2.2/ChangeLog0000644000175000017500000001714412723742051011432 0ustar wtThu, June 2, 2016: Wolfgang Trexler * Version 2.2 - minor changes * removed define(@array) as this is deprecated in newer perl versions * Added better explanations if ImageMagick or GraphicsMagick files can not be found Mon, May 28, 2012: Alexander Zangerl, Wolfgang Trexler * Version 2.1 * igal now supports EXIF data with option -e * Perl Module Image::ExifTools is needed if this option is used * Thanks to Daniel Weuthen for the initial contribution * Files: igal2.css, slidetemplate2.html changed to support EXIF data Mon, Nov 16, 2008: Wolfgang Trexler * Version 2.0 * changed name to igal2 * changed default installation directory to /usr/local/lib/igal2 * igal2 now supports paging, that means if there a more than a given number of fotos several index pages are generated. ie. index.html, 1index.html, 2index.html, etc. see help for parameter "-pagination " * added version information in indextemplate2 * changed utilities/igal2.sh to force paging after 50 fotos Wed, Feb 27, 2008: Riku Kalinen * Version 1.4.7-wt * Riku repaired option "--xy" which should now be working as promised Attention: Due to the bug (missing implemenation) option --xy did the same as -y, so if you used --xy please be aware that the outcome now may be surprising ;-) * Changed utilities/igal.sh to use -y instead of -xy Thu, Nov 22, 2007: Stewart Addison (contactsxa@gmail.com) * Version 1.4.6-wt * bug fixing - option -s the css file isn't copied across so you don't get the tiles displayed. * -m Automatically add watermark to each image - this works well with a transparent .gif, but anything can be used - edit the "composite" line later on to adjust visibility/position of mark if required Originals will be left with a .unmarked extension * -o Root URL of alternate location for the links to full size images. Use this if your indexes will be in a different location/server from the back end images Mon, Jul 11, 2006: (Wolfgang Trexler) * igal enhanced 1.4.5-wt contains bug-fix in "option -n" to 1.4.4-wt * line 422 - with option -n handle filenames with more than one dot "." correct Mon, Jan 3, 2005: (Wolfgang Trexler) * igal enhanced 1.4.4-wt contains improvements and bug-fixes to 1.4.1-wt * igal now also generates indexes for directories containing only 1 image * minor code cleanup Fri, April 11, 2003: * igal enhanced 1.4.1-wt is an enhanced version of original igal 1.4 * This release was done by Wolfgang Trexler * Support for image filenames with international characters and special characters like \, <, >, #, %, " or white space. igal no longer renames your files if they contain characters that are not URL conform. Instead igal will escape (%xx) them inside the HTML code. * Option --dest Before this version igal placed all igal helper files (thumbnails, slidefiles, CSS, etc) in the directory where the image files reside. With this option these files can be placed in a subdirectory of the image directory. * Option --AddSubdir If igal finds subdirectories below your image directory it can add links to this directories in the index.html file Note: igal will not work recursively, it just adds links. Mon, Feb 3, 2003: * igal 1.4 released Sun, Feb 2, 2003: * write useful navigation info (e.g next/prev image name, captions) inside TITLE tags which will show as pop-up info on most browsers * the small tile graphic is now tile.png (was tile.gif) * enable PNG support in igal! (if ImageMagick is installed) * eliminate -e option * updated man page Tue, Jan 14, 2003: * igal 1.4 released on the website only, for beta testing * thanks for beta testing: Ken ??? Mon, Jan 13, 2003: * HUGE speed improvement with ImageMagick (almost 3x faster): convert now internally uses -scale (not -geometry) to resize thumbs and medium-size slides (when --bigy is used). Output quality of scaled-down images is about the same, but igal runs *much* faster. As a consequence, igal now uses ImageMagick tools first if available, else it falls back onto cjpeg/djpeg * igal now writes out the command line options with which it was invoked inside a META tag at the top of the index.html file Tue, Jan 07, 2003: * when --bigy is given don't re-generate the medium-size slides if they already exist, unless the -f switch is given * updated man page Mon, Jan 06, 2003: * make use of convert instead of mogrify to rescale images * new option --con to pass command line options to convert or cjpeg (for controlling thumbnail quality, adding noise, etc.) * downscaled tile.gif image from 20x28 to 15x21 (extensive research and comparisons with 35mm film has shown that this makes it more true to scale next to thumbnails of default height 75) * option -t now can adjust (mogrify) the tile.gif size on the fly * eliminated option -b since thumbnail background is now set w/CSS Sun, Jan 05, 2003: * constrict output of identify by forcing -format switch, this should help igal deal w/future changes in ImageMagick's command identify * divide by 1024, not 1000 to get image sizes from bytes to kilobytes * obscure bug fixed: when -c and -y were used together sometimes igal would incorrectly think it had havelj = 0 (thanks Per Starback) * introduced CSS! style settings are in the igal.css template * index AND slide template are HTML 4.01 compliant (validator.w3.org) Mon, Nov 19, 2001: * version 1.3 released Sun, Nov 18, 2001: * fixed error with newer ImageMagick packages (5.3.x) * fixed pre-loading of unscaled image when --bigy is used * fixed case-sensitive distinction between -c and -C * added option -u to put image captions (or names) under thumbnails on main index page * re-ordered options list alphabetically when igal -h is called * acknowledge option -r and don't look to find .tile.gif * noted URI spec page moved to http://www.ietf.org/rfc/rfc2396.txt * updated man page Wed, Aug 23, 2000: * version 1.2 released Tue, Aug 22, 2000: * updated man page * made --www into a post-processing option, e.g it's run at the end. Mon, Aug 21, 2000: * added option -C to preserve file names as captions in .captions file * added ability to mix JPG and GIF files in the same slide show. * sort the mixed JPG and GIF files alphabetically * improved user warnings. Wed, Aug 16, 2000: * added support for a $HOME/.igal directory with user templates * added ability to shrink huge slides on the fly (option --bigy) Mon, Aug 14, 2000: * added ability to include image size information on the main index page, underneath the thumbnails (options -a, --ad and --as) * switched to support GIF images only if ImageMagick is installed * fixed bug in regexp when reading the image size info from identify Wed, Aug 09, 2000: * version 1.1 released Tue, Aug 08, 2000: * added checks to make sure file names conform to the URI specs from http://info.internet.isi.edu/in-notes/rfc/files/rfc2396.txt before they are included in the HTML slides or index. According to section 2.4.3 of that document, URIs may not contain delimiters such as <, >, #, %, " or white space. * added three ways of dealing with these malformed file names. (suppress symbols/replace spaces with underscores, replace all with underscores or just suppress all). * added version number in --help output. Sun, Aug 06, 2000: * bugfix: enabled -i option * added double quotes around all internal references to file names being used in system calls (to handle file names with symbols) * bugfix: fixed small bug with -k and -n options Sat, Aug 05, 2000: * added code to convert spaces to underscores in image file names Fri, Aug 04, 2000: * version 1.0 released igal2-2.2/utilities/0000755000175000017500000000000011110104720011644 5ustar wtigal2-2.2/utilities/igal2-cron1.sh0000755000175000017500000000036211110076573014240 0ustar wt# SCRIPTPATH="/usr/local/bin"; # echo "Examing $1"; FOUND=`find "$1/" -iname "*.jpg" -maxdepth 1`; if [ \( ! -f "$1/index.html" \) -a -n "$FOUND" ]; then echo "--> $1: Index missing... calling igal2..."; $SCRIPTPATH/igal2.sh "$1"; fi; igal2-2.2/utilities/igal2.sh0000755000175000017500000000015011110076612013205 0ustar wt# # /usr/local/bin/igal2 -n --bigy 510 -y 140 --dest ".igal" --AddSubdir -u -www -pagination 50 -d "$1" igal2-2.2/utilities/igal2-recursive.sh0000755000175000017500000000021011110076600015204 0ustar wt# find $1 -type d -xdev ! -name "\.igal" -exec igal2 -n --bigy 510 -xy 140 --dest ".igal" --AddSubdir -u -www -pagination 50 -d "{}" \; igal2-2.2/utilities/igal2-cron.sh0000755000175000017500000000015711110076575014163 0ustar wt# SCRIPTPATH="/usr/local/bin"; find $1 -type d -xdev ! -name "\.igal" -exec $SCRIPTPATH/igal2-cron1.sh "{}" \; igal2-2.2/igal20000755000175000017500000011257412723742065010614 0ustar wt: magical incantation finds Perl as long as it's in the user's path eval 'exec perl -wS $0 ${1+"$@"}' if 0; ############################################################################ # Please change this accordingly if you change the DESTDIR in the tarball # distribution Makefile or the --prefix of the RPM installation $LIBDIR = "/usr/local/lib/igal2"; # for example if you make DESTDIR=/usr then $LIBDIR="/usr/lib/igal2" ############################################################################ # # A short note from Eric Pop the developer of the "old" igal version: # Note to do-it-yourselvers and Computer Science types: the IGAL code is # UGLY. I'm am amateur programmer, not a CS type. If my scrappy code runs # and gives the right results, I'm happy. If others find it useful, that's # wonderful. I hope my comments can help decipher the mess below a bit. I # wrote IGAL partly because I wanted another excuse to learn Perl (it's # useful for my research too) and because other image gallery generators # had hairy dependencies and didn't do what I needed. So... my apologies # if the spaghetti below makes you cringe. It works for me, so I don't # really have plans (or time) to clean it up. # ############################################################################ # If you KNOW you have the ImageMagick package installed (e.g commands like # identify and convert) then setting this equal to 1 may speed up the code a # bit (igal will stop checking for these commands every time it runs) # $HAVEIM = 0; ############################################################################ # If you KNOW you have the libjpeg stuff installed (e.g commands like cjpeg, # djpeg and pnmscale) then setting this equal to 1 may speed up the code a # bit (igal will stop checking for these commands every time it runs) # $HAVELJ = 0; ############################################################################ # This is IGAL version 2.2, an online Image GALlery generator. # Copyright (C) 2000 Eric Pop, 2003 Wolfgang Trexler # This version was enhanced by Wolfgang Trexler (wt) Apr. 2003 - May 2016 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Author: Eric Pop, Dept. of Electrical Engineering, Stanford University # Email: epop@stanford.edu # Enhancements were done by: Wolfgang Trexler, Alexander Zangerl # EMail: wt-igal@trexler.at use FileHandle; use Getopt::Long; use POSIX qw(ceil floor); # Check if EXIF Tool library is installed $ExifTool = eval "use Image::ExifTool; 1" ? 1 : 0; # some constants $VERSION = "2.2"; $Getopt::Long::ignorecase = 0; $itile = "tile.png"; $slidetemplate = "slidetemplate2.html"; $indextemplate = "indextemplate2.html"; $csstemplate = "igal2.css"; $directorylinefile = "directoryline2.html"; $captionfile = ".captions"; $userigaldir = "$ENV{'HOME'}/.igal2"; $thumbprefix = ".thumb_"; $slideprefix = ".slide_"; $destback = ""; STDOUT->autoflush("1"); # default command-line argument values $opt_a = "0"; # to write image size under thumbnails in index page $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 = "0"; # write EXIF information under image $opt_f = "0"; # -f to force thumbnail regeneration $opt_h = "0"; $opt_i = "index.html"; # name of the main thumbnail index file $opt_k = "0"; # -k for the captions to also be used as slide titles $opt_m = ""; # -m Apply a watermark to each image $opt_n = "0"; # -n to use image file names for the .html files $opt_o = ""; # -o dir specifies alternate prefix for target links $opt_p = "3"; # cellpadding value for the thumbnail index tables $opt_r = "0"; # -r to omit the film reel effect altogether $opt_s = "0"; # -s to make no slides, just thumbnail links to images $opt_t = "21"; # height of the .tile.png tiled image $opt_u = "0"; # write captions under thumbnails on index page $opt_w = "5"; # index rows are 5 images wide by default $opt_x = "0"; # -x to omit the image count from the caption $opt_y = "0"; # max height of a thumbnail (defaults to 75 below) $opt_ad = "0"; # write out only dimensions $opt_as = "0"; # write out only file size $opt_bigy = "0"; # max height of the slides. use if images are huge. $opt_con = ""; # options to be passed to convert or cjpeg $opt_help = "0"; # displays brief usage message; same as -h $opt_www = "0"; # makes everything world-readable $opt_xy = "0"; # scale thumbs to n pixels in their longer dimension $opt_dest = ""; # Destination directory of helper files $opt_AddSubdir = "0"; # Add subdirectories to index.html file $opt_pagination = "0"; # maximum number of images on one page, zero means no pagination $usage = <<"END_OF_USAGE"; This is iGal2 $VERSION an HTML image slide show generator. Syntax: igal [-option -option ...] Options: -a write image sizes under thumbnails on index page -c first generate and then use captions -C like -c, but preserve file names as captions -d operate on files in directory (.) -e write EXIF information under image (needs Image::ExifTool) -f force thumbnail regeneration -h displays this brief help; same as --help -i name of the main thumbnail index file (index.html) -k use the image captions for the HTML slide titles -m Automatically add watermark to each image -n use image file names for the HTML slide files -p cellpadding value of thumbnail index tables (3) -r omit the film reel effect altogether -s make no HTML slides, link thumbnails to images -t height of the film reel tiled image (21) -u write captions under thumbnails on index page -w rows in thumbnail index are images wide (5) -x omit the image count from the captions -y scale all thumbnails to the same height (75) --ad like -a, but write only the image dimensions --as like -a, but write only the file size (in kbytes) --bigy like -y, use it if you have very large image files --con <> options to pass to convert or cjpeg (e.g. -quality N) --help displays this brief help; same as -h --www make all iGal files world-readable --xy scale thumbs to pixels in their longer dimension ------------- N E W F U N C T I O N S -------------------------- --dest Destination directory for the helper files (thumbnails, slides, etc.) igal generates. This is relative to the operative directory -d and has to be one level below (.) --AddSubdir If igal finds further directories beneath your image directory -d, it will generate HTML Links in the index file (index.html) to this directories. Default is (off). Directories given with --dest or starting with a "." will be ignored. Note: igal will not work recursively, it just adds HTML links to the directories below. -m Automatically add watermark to each image - this works well with a transparent .gif, but anything can be used - edit the "composite" line later on to adjust visibility/position of mark if required Originals will be left with a .unmarked extension -o Root URL of alternate location for the links to full size images. Use this if your indexes will be in a different location/server from the back end images --pagination Maximum number of images on one page. If the given number of images is reached a new page is started. Pagination number should be a multiple of parameter -w (default 5). Default 0 - means no pagination at all. Note: default values are given in parentheses (where applicable). Authors: Wolfgang Trexler Eric Pop (original igal) contributions: Stewart Addison , Riku Kalinen, Alexander Zangerl URL: http://igal.trexler.at/ END_OF_USAGE # store command-line options upfront to write in the index @igal_options = @ARGV; # process command-line arguments (overriding defaults above) GetOptions('a','c','C','d=s','e','f','h','i=s','k','m=s','n','o=s', 'p=i','r','s','t=i','u','w=i','x','y=i','ad','as', 'bigy=i', 'con=s','help','im','www','xy=i', 'dest=s', 'AddSubdir', 'pagination=s') or die "$usage"; die $usage if ($opt_help or $opt_h); # deal with the competing -y and --xy options if (($opt_y == 0) and ($opt_xy == 0)) { $opt_y = 75; # default, if neither -y nor --xy is specified } else { $opt_f = "1"; # if either is specified, force thumbnail regeneration } die "Please only specify one of the -y and --xy options\n" if ($opt_y and $opt_xy); # other error (sanity) checks die "Please enter nonnegative thumbnail dimensions\n" if (($opt_y < 0) or ($opt_xy < 0)); die "Please enter a nonnegative cellpadding value\n" if ($opt_p < 0); die "Please choose at least one image per index row\n" if ($opt_w <= 0); die "Please enter a nonnegative tiled image height\n" if ($opt_t < 0); die "Please enter a nonnegative pagination value\n" if ($opt_pagination < 0); $opt_o = "$opt_o/" if ( $opt_o ); die "Critical failure: Lib Image::ExifTool not install but EXIF Tags (option -e) requested\n" if (($ExifTool == 0) and ($opt_e)); # strip any unnecessary slashes from the end of the given $opt_d directory $opt_d =~ s/\/$//; # let users store their templates in a $HOME/.igal directory, if it exists, # instead of the site-wide /usr/local/lib/igal (from line 8 up top) $LIBDIR = $userigaldir if ((-r $userigaldir) && (-d $userigaldir)); # load up image files from $opt_d into array @imgfiles opendir DIR, $opt_d or die "Can't open directory $opt_d\n"; # find and read all jp(e)g, gif and png files @jpgfiles = grep((!/^\./ and /\.jpe?g$/i), readdir DIR); rewinddir DIR; # this is CRUCIAL here!!! @giffiles = grep((!/^\./ and /\.gif$/i), readdir DIR); rewinddir DIR; # this is CRUCIAL here!!! @pngfiles = grep((!/^\./ and /\.png$/i), readdir DIR); @imgfiles = @jpgfiles; push(@imgfiles, @giffiles); push(@imgfiles, @pngfiles); @imgfiles = sort @imgfiles; # sort alphabetically, by file name $njpg = @jpgfiles; $nfiles = @imgfiles; # how many total image files i've loaded die "Can't find any image files in directory $opt_d\n" if ($nfiles == 0); # find and read all directories (except beginning with . and igal destination) for later use if ($opt_AddSubdir) { rewinddir DIR; foreach $file (readdir DIR) { if (-d "$opt_d/$file" && !($file =~ /^\./) && !($file =~ /$opt_dest/)) { push(@directories, $file); } } if (@directories) { @directories = sort @directories; # sort alphabetically, by name } else { print "Information: Option --AddSubdir is set, but can't find any matching subdiretories!\n"; } } closedir DIR; # Store image extensions @imgext = (); @captions = (); foreach $file (@imgfiles) { # store image captions & extensions in separate arrays along the way $file =~ m/(^.*)\.(\w{3,4})$/; push(@captions, $1); push(@imgext, $2); } # wt 08.04.03: check for destination directory of igal files, and create it if necessary $opt_dest =~ s/\/$//; # strip any unnecessary slashes from the end of the given $opt_dest directory if (length $opt_dest > 0) { if ($opt_dest =~ m/(\/|\\|\#|<|>|%|\"|\s)/) { die "\nYour destination directory ($opt_dest) contains a character ($1) which\nis not allowed inside an URL. URIs may not contain delimiters such as \\, <, >, #, %, \" or \nwhite space.\n\n"; } if (! -d "$opt_d/$opt_dest") { mkdir "$opt_d/$opt_dest" or die "Can't create directory for igal files ($opt_d/$opt_dest) [$!]"; } print "Using directory $opt_d/$opt_dest for igal files (except for index.html)\n"; $opt_dest = "$opt_dest/"; # Append / to directory for further use $destback = "../"; # will be used in html later on to find the directory where images reside } # if the -c (or -C) option was supplied let user specify captions, else see below if ($opt_c or $opt_C) { if (! -r "$opt_d/$opt_dest$captionfile") { # create $captionfile file if it doesn't exist print "Found $nfiles image files in directory $opt_d\n"; # die "Please select more files for your slide show!\n" if ($nfiles <= 1); open(CAP,">$opt_d/$opt_dest$captionfile") or die "Can't create $opt_d/$opt_dest$captionfile file\n"; print "Creating the $opt_dest$captionfile file...\n"; print CAP "# This is igal's $captionfile file, first generated ", scalar localtime, ".\n"; print CAP "# To the left of the separator are the image file names. Enter your captions\n# on the right side, one per line. The captions may include HTML tags.\n# To add any comments to this file or to exclude any images from the slide \n# show, add a # sign at the beginning of their respective lines. You may\n# also change the order of images in your slide show at this time.\n\n"; for ($i = 0; $i < $nfiles; $i++) { print CAP "$imgfiles[$i] ---- "; print CAP "$captions[$i]" if $opt_C; print CAP "\n"; } close(CAP); die "Now edit the $opt_dest$captionfile file to your liking and rerun igal -c\n"; } else { # read in files specified in the .captions file open(CAP,"$opt_d/$opt_dest$captionfile") or die "Can't open $opt_d/$opt_dest$captionfile file\n"; @imgfiles = (); # reset arrays b/c we're rereading them @captions = (); @imgext = (); $njpg = 0; print "Reading the $captionfile file ... "; while (defined($line = )) { chomp($line); $line =~ s/^\s*//; $line =~ s/\s*$//; # only read lines with the ---- delimiter that don't start with # if (($line =~ m/\w\s*----\s*/) && !($line =~ m/^\#/)) { @arr = split(/\s*----\s*/,$line); # first check image extensions $temp = $arr[0]; $temp =~ s/^.*\.//; push(@imgfiles,$arr[0]); push(@imgext, $temp); push(@arr,"") if (scalar @arr == 1); push(@captions,$arr[1]); $njpg++ if ($arr[0] =~ m/jpe?g/i); } } close(CAP); $nfiles = @imgfiles; print "found $nfiles image files.\n"; die "Please select more files for your slide show!\n" if ($nfiles < 1); } } else { print "Found $nfiles image files in directory $opt_d\n"; } # find out if the imagemagick commands exist $HAVEIM = (&exist("identify") and &exist("convert")) unless ($HAVEIM); print "\nWARNING: commands identify/convert missing!\nThe ImageMagick (imagemagick.org) or GraphicsMagick package with compatibility doesn't seem to be\ninstalled. Image dimensions will not be available in the generated HTML.\nOnly JPG images are supported... falling back onto cjpeg/djpeg/pnmscale.\n\n" unless ($HAVEIM); # find out if the libjpeg commands exist $HAVELJ = (&exist("cjpeg") and &exist("djpeg") &exist("pnmscale")) unless ($HAVELJ or ($njpg == 0) or $HAVEIM); print "\nWARNING: at least one of the commands \"cjpeg\", \"djpeg\" and \"pnmscale\" is not\ninstalled. You can find these at rpmfind.net (inside libjpeg and libgr-progs)\nor you can download the source code from:\n http://www.ijg.org/ and\n http://netpbm.sourceforge.net/\n\n" unless ($HAVELJ or ($njpg == 0) or $HAVEIM); # give up if no image processing commands can be found die "ERROR: the necessary image processing tools aren't installed on your system.\nPlease obtain them as specified above.\n\n" unless ($HAVEIM or $HAVELJ); # initialize the arrays that will hold image file sizes @xdim=(); @ydim=(); @isiz=(); # Jan 13, 2003: i played around w/the various ways in which convert can # resize images, i.e with -scale, -sample, -geometry (equivalent to -resize) # and lo and behold, i realized that igal will run MUCH faster when resizing # is done with -scale while quality is about same as with -geometry (in igal # 1.3 and earlier). using -sample gives me a bit more speed advantage but # is not worth using as the scaled-down output seems to be pretty poor. # here are some timed-runs on a directory w/some images: # * w/convert -sample (poor quality) 7.24 sec # * w/convert -scale (ok quality) 9.14 sec # * w/convert -resize (ok quality) 23.8 sec # * w/cjpeg/djpeg (ok quality) 20.1 sec # so from now on all convert -scale is used everywhere below because it seems # to be the clear winner for quality vs speed. # generate .thumbnails in the same directory with the original image files (or in the given --dest directory) # if they don't exist already or if the -f switch is given print "Creating thumbnails: "; for ($i = 0; $i < $nfiles; $i++) { $file = $imgfiles[$i]; $fullfile = "$opt_d/$file"; die "Can't open $fullfile\n" unless (-r $fullfile); $fullthumb = "$opt_d/$opt_dest$thumbprefix$file"; if ((! -e $fullthumb) or $opt_f) { if ($HAVEIM) { $command = "convert $opt_con -scale x$opt_y \"$fullfile\" \"$fullthumb\""; # opt_xy handling: determine dimensions and scale the bigger dimension # Bug fixing code new since version 1.4.7 if ($opt_xy) { $temp = `identify -ping -format \"\%wx\%h %b\" \"$fullfile\"`; $temp =~ m/(\d+)x(\d+)\s([\d\.]+[mkb]*)/i; $width = $1; $height = $2; $temp = $3; if ($width > $height) { $dimension = "$opt_xy" . "x"; } else { $dimension = "x" . "$opt_xy"; } $command = "convert $opt_con -scale $dimension \"$fullfile\" \"$fullthumb\""; } } else { if ($imgext[$i] =~ m/(gif|png)/i) { print "\nIgnoring $file: get ImageMagick (imagemagick.org) to process GIF and PNG files.\n"; $command = 0; } else { $com1 = "djpeg \"$fullfile\""; $com3 = "cjpeg $opt_con -outfile \"$fullthumb\""; $scale = "pnmscale -ysize $opt_y"; $scale = "pnmscale -xysize $opt_xy $opt_xy" if ($opt_xy); $command = $com1 . " | " . $scale . " | " . $com3; } } system("$command") if ($command); print "$thumbprefix$file " if ($command); } } print "... done!\n"; # determine image file sizes if ($HAVEIM && !($opt_bigy)) { print "Determining image sizes "; foreach $file (@imgfiles) { $fullfile = "$opt_d/$file"; $temp = `identify -ping -format \"\%wx\%h %b\" \"$fullfile\"`; $temp =~ m/(\d+)x(\d+)\s([\d\.]+[mkb]*)/i; push(@xdim,$1); push(@ydim,$2); $temp = $3; # round nicely in kb if identify returned the size in bytes $temp = sprintf ("%.1fk", $temp/1024) if ($temp =~ s/([\d\.]+)b*$/$1/i); push(@isiz,$temp); print "."; } print " done!\n"; } # scale down slides if the --bigy option was given if ($opt_bigy and !($opt_s)) { if ($HAVEIM) { print "Scaling down big slides and determining new slide sizes: "; @xdim=(); @ydim=(); @isiz=(); # reset image size arrays } else { print "Scaling down big slides: "; } for ($i = 0; $i < $nfiles; $i++) { $file = $imgfiles[$i]; $fullfile = "$opt_d/$file"; die "Can't open $fullfile\n" unless (-r $fullfile); $fullslide = "$opt_d/$opt_dest$slideprefix$file"; if ((! -e $fullslide) or $opt_f) { if ($HAVEIM) { $command = "convert $opt_con -scale x$opt_bigy \"$fullfile\" \"$fullslide\""; } else { if ($imgext[$i] =~ m/(gif|png)/i) { print "\nIgnoring $file: get ImageMagick (imagemagick.org) to process GIF and PNG files.\n"; $command = 0; } else { $com1 = "djpeg \"$fullfile\""; $com3 = "cjpeg $opt_con -outfile \"$fullslide\""; $scale = "pnmscale -ysize $opt_bigy"; $command = $com1 . " | " . $scale . " | " . $com3; } } system("$command") if ($command); print "$slideprefix$file " if ($command); } if ($HAVEIM) { $temp = `identify -ping -format \"\%wx\%h %b\" \"$fullslide\"`; $temp =~ m/(\d+)x(\d+)\s([\d\.]+[mkb]*)/i; push(@xdim,$1); push(@ydim,$2); $temp = $3; # round nicely in kb if identify returned the size in bytes $temp = sprintf ("%.1fk", $temp/1024) if ($temp =~ s/([\d\.]+)b*$/$1/i); push(@isiz,$temp); } } print "... done!\n"; } if ( $opt_m ) { # This is a fairly simple watermarking method - this could be made # more complex ... die "ImageMagick required for watermarking\n" if (! &exist("composite")); die "Cannot open watermark file $opt_m" if ( ! -r $opt_m ); print "Adding watermarks:"; for ($i = 0; $i < $nfiles; $i++) { $file = $imgfiles[$i]; $original = "$file.unmarked"; # If original exists, user has re-run the script - don't # add a second watermark if ( -r $original ) { print " [$file already marked]"; } else { die "Can't open $file\n" unless (-r $file); rename $file, $original || die "Failed to rename $file to $original"; print " $file"; # Could add '&& unlink $original' but wouldn't protect against reruns system "composite -dissolve 33 -geometry +20+20 $opt_m $original $file"; die "Failed to add watermark to $file" if ( ! -r $file ); } } print "\nPre-watermarked files have been left with a .unmarked extension\n"; print "You may wish to remove those before publishing the gallery\n"; } # create the individual slide show files if ($opt_s) { print "Linking thumbnails directly to image files... Making no html slides.\n"; if (! -e "$opt_d/$opt_dest$csstemplate") { print "No CSS template file ... getting $LIBDIR/$csstemplate\n"; die "$LIBDIR cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r $LIBDIR); die "$LIBDIR/$csstemplate cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r "$LIBDIR/$csstemplate"); system("cp -f $LIBDIR/$csstemplate \"$opt_d/$opt_dest\""); } } else { $nfiles = @imgfiles; # total number of files (same as # of captions) @slides = (); if ($opt_n) { # decide on the slide html file names for ($i = 0; $i < $nfiles; $i++) { $temp = $imgfiles[$i]; $temp =~ s/\.\w+?$/\.html/; # strip suffix, bug fixing (1.4.5) push(@slides,$temp); } } else { for ($i = 0; $i < $nfiles; $i++) { push(@slides, $i+1 . ".html"); } } system("rm -f \"$opt_d/$opt_dest*.html\""); if (! -e "$opt_d/$opt_dest$csstemplate") { print "No CSS template file ... getting $LIBDIR/$csstemplate\n"; die "$LIBDIR cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r $LIBDIR); die "$LIBDIR/$csstemplate cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r "$LIBDIR/$csstemplate"); system("cp -f $LIBDIR/$csstemplate \"$opt_d/$opt_dest\""); } else { print "Found CSS template file $opt_dest$csstemplate ... using it.\n"; } if (! -e "$opt_d/$opt_dest.$slidetemplate") { print "No $opt_dest.$slidetemplate file ... getting a copy from $LIBDIR/\n"; die "$LIBDIR cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r $LIBDIR); die "$LIBDIR/$slidetemplate cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r "$LIBDIR/$slidetemplate"); system("cp -f $LIBDIR/$slidetemplate \"$opt_d/$opt_dest.$slidetemplate\""); } else { print "Found $opt_dest.$slidetemplate file ... using it.\n"; } print "Creating individual slides: "; # read slidetemplate from filesystem once $slidetemplate_string = read_file_in_string("$opt_d/$opt_dest.$slidetemplate"); for ($i = 0; $i < $nfiles; $i++) { $workarea = $slidetemplate_string; # fill work area with slidetemplate open(SW,">$opt_d/$opt_dest$slides[$i]") or die "Can't create slide file\n"; print "$slides[$i] "; if ($opt_k) { # use image caption for the HTML slide title $title = $captions[$i]; } else { # otherwise use the image name (strip suffix) $title = $imgfiles[$i]; $title =~ s/\.\w+?$//; } $workarea =~ s//$title/g; $imgfile_i_encoded = URLencode($imgfiles[$i]); if ($opt_bigy) { $slide = URLencode($slideprefix . $imgfiles[$i]); if ($HAVEIM) { $workarea =~ s/(<.*)(.)(.*>)/$1$slide$2 width=$xdim[$i] height=$ydim[$i] alt=\"$title\" title=\"click to see full-size\"$3<\/a>/; } else { $workarea =~ s/(<.*)(.)(.*>)/$1$slide$2 alt=\"$title\" title=\"click to see full-size\"$3<\/a>/; } } else { if ($HAVEIM) { $workarea =~ s/(.)/$destback$imgfile_i_encoded$1 width=$xdim[$i] height=$ydim[$i] alt=\"$title\"/g; } else { $workarea =~ s//$destback$imgfile_i_encoded/g; } } # add in the image counter unless -x is specified if ($opt_x) { $imagecaption = $captions[$i]; } else{ $imagecaption = $captions[$i] . "   (" . ($i+1) ."/$nfiles)" if (! $opt_x); } $workarea =~ s//$imagecaption/g; # add EXIF information if -e is specified if ($opt_e) { my $exif=Image::ExifTool::ImageInfo($imgfiles[$i]); my $exifinfo= "Show/hide EXIF data\n"; $exifinfo .= "
    \n"; $exifinfo .= "\n"; for my $k (sort keys %$exif) { $exifinfo .= "\n"; } $exifinfo .= "
    EXIF TagValue
    $k". (ref($exif->{$k}) eq "SCALAR"?'Binary data '.length(${$exif->{$k}}).' bytes':$exif->{$k})."
    \n"; $workarea =~ s//$exifinfo/g; } # find out if pagination is used and which number the index file has... $index_file_number = ($opt_pagination) ? int ($i / $opt_pagination) : 0; $index_filename = ($index_file_number == 0) ? $opt_i : "$index_file_number$opt_i"; $workarea =~ s//$destback$index_filename/g; if ($opt_bigy) { $pref = $slideprefix; } else { $pref = $destback; } if ($i == 0 && $nfiles == 1) { # special treatment if there is exactly one file! $temp = URLencode("$pref$imgfiles[0]"); $workarea =~ s//$temp/g; $temp = URLencode("$slides[0]"); $workarea =~ s//\"$temp\" title=\"$captions[0]\"/g; $temp = URLencode("$slides[0]"); $workarea =~ s//\"$temp\" title=\"$captions[0]\"/g; } elsif ($i == 0) { # first image, previous points to last image $temp = URLencode("$pref$imgfiles[$i+1]"); $workarea =~ s//$temp/g; $temp = URLencode("$slides[$nfiles-1]"); $workarea =~ s//\"$temp\" title=\"$captions[$nfiles-1]\"/g; $temp = URLencode("$slides[$i+1]"); $workarea =~ s//\"$temp\" title=\"$captions[$i+1]\"/g; } elsif ($i == $nfiles-1) { # last image, next points to first image $temp = URLencode("$pref$imgfiles[0]"); $workarea =~ s//$temp/g; $temp = URLencode("$slides[$i-1]"); $workarea =~ s//\"$temp\" title=\"$captions[$i-1]\"/g; $temp = URLencode("$slides[0]"); $workarea =~ s//\"$temp\" title=\"$captions[0]\"/g; } else { $temp = URLencode("$pref$imgfiles[$i+1]"); $workarea =~ s//$temp/g; $temp = URLencode("$slides[$i-1]"); $workarea =~ s//\"$temp\" title=\"$captions[$i-1]\"/g; $temp = URLencode("$slides[$i+1]"); $workarea =~ s//\"$temp\" title=\"$captions[$i+1]\"/g; } print SW "$workarea"; close(SW); } print "... done!\n"; } ############################################################################# # create the main index file with all the thumbnails if ($opt_r) { print "Got option -r... omitting film reel effect.\n"; } elsif (! -e "$opt_d/$opt_dest.$itile") { print "No $opt_dest.$itile file... getting a copy from $LIBDIR/\n"; die "$LIBDIR cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r $LIBDIR); die "$LIBDIR/$itile cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r "$LIBDIR/$itile"); system("cp -f $LIBDIR/$itile \"$opt_d/$opt_dest.$itile\""); } else { print "Found $opt_dest.$itile file ... using it.\n"; } # rescale the tiled image if the -t switch was called but -r wasn't if (($HAVEIM) and (! $opt_r)) { $tileh = `identify -ping -format \"\%wx\%h %b\" \"$opt_d\/$opt_dest.$itile\"`; $tileh =~ s/\d+x(\d+)\s[\d\.]+./$1/; system("mogrify -scale x$opt_t $opt_d/$opt_dest.$itile") if ($opt_t != $tileh); } if (! -e "$opt_d/$opt_dest.$indextemplate") { print "No $opt_dest.$indextemplate file... getting a copy from $LIBDIR/\n"; die "$LIBDIR cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r $LIBDIR); die "$LIBDIR/$indextemplate cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r "$LIBDIR/$indextemplate"); system("cp -f $LIBDIR/$indextemplate \"$opt_d/$opt_dest.$indextemplate\""); } else { print "Found $opt_dest.$indextemplate ... using it.\n"; } print "Creating the index file(s) "; $indexfile = read_file_in_string("$opt_d/$opt_dest.$indextemplate"); # read indexfile in string to parse it $indexfile =~ s//@igal_options/g; # set comment about igal options in index file $indexfile =~ s//$opt_dest$csstemplate/g; # set the name (and path) of css template file # Generate the links for directories if ($opt_AddSubdir && @directories) { if (! -e "$opt_d/$opt_dest.$directorylinefile") { print "No $opt_dest.$directorylinefile file ... getting a copy from $LIBDIR/\n"; die "$LIBDIR cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r $LIBDIR); die "$LIBDIR/$directorylinefile cannot be read or does not exist.\nPlease install igal properly.\n" unless (-r "$LIBDIR/$directorylinefile"); system("cp -f $LIBDIR/$directorylinefile \"$opt_d/$opt_dest.$directorylinefile\""); } else { print "Found $opt_dest.$directorylinefile file ... using it.\n"; } $output = ""; $directoryline = read_file_in_string("$opt_d/$opt_dest.$directorylinefile"); foreach $directory (@directories) { $temp = $directoryline; $temp =~ s/#DIRECTORY#/$directory/g; $directoryURLencoded = URLencode($directory); $temp =~ s/#DIRECTORY-URLENCODED#/$directoryURLencoded/g; $output .= $temp; } $indexfile =~ s//$output/; } else { $indexfile =~ s/.*//s; } $indexfile =~ s//$VERSION/g; #add version information #generate the table rows $indexfile_copy = $indexfile; if ($opt_pagination && $nfiles > $opt_pagination) { # pagination necessary! $paginate = $opt_pagination; } else { # no pagination necessary $paginate = $nfiles; } for ($page = 0; $page * $paginate < $nfiles; $page++) { $output = ""; $indexfile = $indexfile_copy; $on_this_page = int (($page+1) * $paginate <= $nfiles) ? $paginate : ($nfiles - $page*$paginate); # number of pictures on page $rows = int $on_this_page/$opt_w; # number of film rows $rem = $on_this_page % $opt_w; # number of thumbnails on last (incomplete) row # print "rows=$rows - rem=$rem - on_this_page=$on_this_page\n"; if ($rem > 0) { $rows++; } # is there a last incomplete row? if yes, we need one more circle for this one for ($i = 1; $i <= $rows; $i++) { # $columns = ($i == $rows && $rem > 0) ? $rem : $opt_w; # last row needs less columns $output .= " \n"; $output .= " \n" unless ($opt_r); $output .= " \n \n"; for ($j = 1; $j <= $columns; $j++) { $fileindex = ($page * $paginate) + (($i-1)*$opt_w+$j-1); # calculate which file is in use # print "i=$i - j=$j (columns=$columns)- fileindex=$fileindex\n"; $output .= " \n"; } $output .= " \n \n"; $output .= " \n" unless ($opt_r); if (($opt_a or $opt_ad or $opt_as) and $HAVEIM) { $output .= " \n \n"; for ($j = 1; $j <= $columns; $j++) { $fileindex = ($page * $paginate) + (($i-1)*$opt_w+$j-1); # calculate which file is in use # print $fileindex; $output .= " \n"; } $output .= " \n"; } # write image captions under images if option -u is given if ($opt_u) { $output .= " \n \n"; for ($j = 1; $j <= $columns; $j++) { $fileindex = ($page * $paginate) + (($i-1)*$opt_w+$j-1); # calculate which file is in use # print $fileindex; $output .= " \n"; } $output .= " \n"; } $output .= "
     
     \n "; if ($opt_s) { $output .= ""; } else { $output .= ""; } print "."; $altname = $captions[$fileindex]; $thumb = $opt_dest . $thumbprefix . $imgfiles[$fileindex]; $thumbEncoded = $opt_dest . URLencode($thumbprefix . $imgfiles[$fileindex]); if ($HAVEIM) { $temp = `identify -ping -format \"\%wx\%h\" \"$opt_d/$thumb\"`; $temp =~ m/(\d+)x(\d+)/; $x=$1; $y=$2; $output .= "\"$altname\""; } else { $output .= "\"$altname\""; } $output .= " 
     
     "; $printdim = "$isiz[$fileindex]" if $opt_as; $printdim = "$xdim[$fileindex]x$ydim[$fileindex]" if $opt_ad; $printdim = "$xdim[$fileindex]x$ydim[$fileindex] ($isiz[$fileindex])" if $opt_a; $output .= $printdim; $output .= "
     " . $captions[$fileindex] . "
    \n
    \n"; } # now replace placeholder in index-file with generated html code $indexfile =~ s//$output/; # insert pageination if ($opt_pagination && $nfiles > $opt_pagination) { # pagination necessary! $numberpages = ceil($nfiles / $opt_pagination); $nextpage = $page+1; $tmptext = "Page $nextpage of $numberpages"; # forward navigation if (($page+1) * $paginate < $nfiles) { $nextpagename = "$nextpage$opt_i"; $lastpage = $numberpages -1; $tmptext .= " >>  >|"; } # backward navigation if ($page > 0) { $prevpage = $page-1; $prevpagename = ($prevpage == 0) ? $opt_i : "$prevpage$opt_i"; $tmptext = "|<  << $tmptext"; } $indexfile =~ s//$tmptext/g; } $indexfile =~ s///g; #clean up $indexfile =~ s///g; #clean up $index_filename = ($page == 0) ? $opt_i : "$page$opt_i"; print "$index_filename "; open(IXW,">$opt_d/$index_filename") or die "Can't create main $index_filename file\n"; print IXW $indexfile; close(IXW); } print " done!\n"; # if --www was invoked make all images world-readable at the END if ($opt_www) { $dir = ($opt_d eq ".") ? $opt_dest : "$opt_d/$opt_dest"; $dir =~ s/\ /\\ /g; # escape blanks in directory/filenames for system call 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"); print "chmod a+r $dir$thumbprefix*.*\n"; system("chmod a+r $dir$thumbprefix*.*"); print "chmod a+r $dir$slideprefix*.*\n"; system("chmod a+r $dir$slideprefix*.*"); print "chmod a+r $dir.$itile\n" unless($opt_r); system("chmod a+r $dir.$itile") unless($opt_r); print "chmod a+r "; # imagefiles are in same directory, therefore $dir has to be set different $dir = ($opt_d eq ".") ? "" : "$opt_d/"; foreach $file (@imgfiles) { print "$dir$file "; system("chmod a+r \"$dir$file\""); } print "\nDone!\n"; } ############################################################################## # subroutine that checks if a certain program is in the user's path # usage &exist("identify") --> 1 (or 0 if it doesn't exist) sub exist { local($program) = @_; foreach $dir (split(/:/,$ENV{'PATH'})) { return 1 if (-f "$dir/$program"); } return 0; } # subroutine that reads a file in a string... # called with $string = read_file_in_string("datei.txt"); sub read_file_in_string { local($filename) = @_; open(FILE,$filename) or die "Can't open file $filename [$!]\n"; local $/; $string = ; close(FILE); return $string; } # subroutine that URL encodes a string... # called with $string = URLencode("text to encode"); sub URLencode { local($string) = @_; $string =~ s/([^a-zA-Z0-9\.\_])/sprintf "%%%02X",ord($1)/eg; return $string } igal2-2.2/tile.png0000644000175000017500000000035510166251354011317 0ustar wtPNG  IHDRkIDATxc````d`a@ X \!ɩ(H2BlV~j\P~\PIuq.7?kj?s(?)3.vBvnk>sٕ9.BP~jg6 @m=U S7a2%Dxy`Vacc  +%IENDB`igal2-2.2/igal2.css0000644000175000017500000000151711760751422011367 0ustar wt.center { text-align: center; } .center table { margin-left: auto; margin-right: auto; text-align: center; } body { font-family: verdana, sans-serif; color: #555555; background-color: white; } a:link, a:visited { color: #001dd9; text-decoration: none; background: transparent; } a:hover { color: #00ffd8; text-decoration: none; } .small { font-size: 75%; } .large { font-size: 200%; } .tiled { background-image: url(".tile.png"); background-repeat: repeat-x; background-color: black; padding: 0; } .thumb { background-color: black; text-align: center; vertical-align: middle; } .slide { background-color: white; text-align: center; vertical-align: middle; } #exifinfo { display: none; padding-top: 5px;} #exifinfo > table, #exifinfo td { border-collapse: collapse; border: 1px solid; } igal2-2.2/Makefile0000644000175000017500000000164011110104720011272 0ustar wt############################################################################ # if you change this, please also modify the value at the top of igal code DESTDIR=/usr/local ############################################################################ BINDIR=$(DESTDIR)/bin MANDIR=$(DESTDIR)/man/man1 LIBDIR=$(DESTDIR)/lib/igal2 OLDLIBDIR=$(DESTDIR)/lib/igal clean:: rm -rf $(LIBDIR) rm -f $(BINDIR)/igal2 rm -f $(BINDIR)/igal rm -f $(MANDIR)/igal2.1 rm -f $(BINDIR)/igal2.sh old-clean:: rm -rf $(OLDLIBDIR) rm -f $(BINDIR)/igal rm -f $(MANDIR)/igal.1 install:: igal2 install -d $(BINDIR) install -m 0755 igal2 $(BINDIR) ln -si $(BINDIR)/igal2 $(BINDIR)/igal install -m 0755 utilities/igal2.sh $(BINDIR) install -d $(MANDIR) install -m 0644 igal2.1 $(MANDIR) install -d $(LIBDIR) install -m 0644 README ChangeLog COPYING indextemplate2.html slidetemplate2.html tile.png igal2.css directoryline2.html $(LIBDIR) igal2-2.2/README0000644000175000017500000000324212723742071010534 0ustar wt****** igal2 README ****** ****** ****** iGal2 needs Perl to run and either cjpeg/djpeg/pnmscale (from libjpeg) or ImageMagick or GraphicksMagick to generate your thumbnails. These come standard with most Linux distributions today. ------------------------------------------------------------------------ To install from the tarball (as root) make install This will put the relevant files in /usr/local/{bin or lib}/igal2 . You can change this destination by modifying the DESTDIR at the top of the Makefile and the LIBDIR variable at the 8th line of iGal code. To uninstall from the tarball (as root) make clean ------------------------------------------------------------------------ UPGRADE from version 1.4 (and older): igal2 supports a lot of new features and therefore the format of the template files had to be changed. igal2 installs all its template files under /usr/local/lib/igal2. Please add your design changes there. If you want to use igal and igal2 side by side, please be sure not to overwrite "igal" when asked through the install script. As igal (1.4) stores all necessary templates and files within the image directory you may savely delete all old igal 1.4 (or older) files when satisfied with igal2. This can be done with make old-clean ------------------------------------------------------------------------ iGal2 is copyright 2000 Eric Pop and Wolfgang Trexler 2016 . It is distributed under the terms of the GNU General Public License, see the file COPYING in the source distribution for details. igal2-2.2/COPYING0000644000175000017500000004307610166251354010716 0ustar wt GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. igal2-2.2/igal2.10000644000175000017500000002321712723740352010740 0ustar wt.\" Process this file with .\" groff -man -Tascii foo.1 .\" .TH igal2 1 "June 2016" "Version 2.2" "Version 2.2" .SH NAME igal2 \- online Image GALlery generator .SH SYNOPSIS .B igal2 .I [-option1 -option2 ...] .SH DESCRIPTION .B igal2 is a quick and easy program for placing your images online with just one command-line invocation. It generates a pretty good-looking set of W3-compliant static HTML slides even with its default settings. To try it out just run .B igal2 in a directory with .IR jpg ", " gif " or " png files and check the output in a web browser. You can adjust the appearance of the image gallery with the many options listed below or (if you know a bit of HTML) by modifying the .IR ".indextemplate.html" , " .slidetemplate.html " and " igal2.css" files that .B igal2 creates in your image directory. .B igal2 also checks for the existence of a .I "$HOME/.igal2" directory where users can store their own templates, overriding the site-wide .IR "/usr/local/lib/igal2" . .BR igal2 " needs " Perl to run and it also relies on a few other programs that come standard with most Linux distributions. It relies on the .B ImageMagick package first if available, otherwise it falls back onto .BR cjpeg "/" djpeg "/" pnmscale " for processing" .IR jpg " files. The command " .BR convert " of the " ImageMagick " package is required to process" .IR gif " and " png files and the .BR identify " command enables " igal2 to include IMG HEIGHT and WIDTH tags in the HTML it generates. .BR If you would like to show the EXIF headers of the images (option -e) Image::ExifTools is needed .SH OPTIONS .TP .B -a Write image dimensions and sizes under each thumbnail on the index page. This only works if the ImageMagick command .BR identify " is present." .TP .B --ad Like .B -a but write only the image dimensions. .TP .B --as Like .B -a but write only the image sizes. .TP .BI --bigy " " Like .B -y but operates on the image slides, not the thumbnails. Scales image slides to some medium height (e.g. .IR 400 ")," adjusting their width accordingly. Useful if your digital camera spits out large images, like 1600x1200. The originals aren't affected, but scaled copies of your images are stored with the .I ".slide" prefix and thumbnails link to these copies. Clicking on the scaled copies in the HTML slides lets users see the full unscaled images. You must use .B -f between two consecutive runs when you've changed the value of .BR "--bigy" . .TP .BI -c First generate and then publish image slide captions. The first invocation of .B igal2 -c generates a .I .captions file that you may edit. The format of this file is very simple. You should only have to enter your captions after the .I ---- separator. You may rearrange the image order at this point and also leave out some pictures by simply placing a pound .RI ( # ) sign at the beginning of their respective lines. A second invocation of .B igal2 -c will read your .I .captions file, include your captions in the slides and rearrange them if necessary. .TP .BI -C .RI Like " -c" but preserve file names as captions when generating the .I .captions file (strips file name suffix). .TP .BI --con " options" Command line options to pass on to .BR convert " or " cjpeg internally (see their man pages). This affects all thumbnails and, if .BI --bigy is given, the medium-size slides too. You can set the .I -quality or go crazy with .IR -negate ", " -noise ", etc." (the last two only work with .BR convert " if " ImageMagick " is installed." .TP .BI -d " " Operate on image files in directory .IR , which is also where the HTML and thumbnail files will be generated. The default is the current directory. .TP .BI -e Extract all EXIF tags from the images and display them on the image slides. This option needs Image::ExifTool to be installed .TP .BI -f Force thumbnail regeneration. Also forces medium-slide regeneration if .BI --bigy is given. Otherwise .B igal2 will not regenerate these files if they already exist, and you may end up with stale copies. Definitely use .BI -f between two runs where you've changed the value of .BR --bigy " or " --con "." .TP .BI -h Display brief help, same as .BR "--help" . .TP .BI --help Display brief help, same as .BR "-h" . .TP .BI -i " " Name of the main thumbnail index file. The default is .IR index.html , as desirable for most web servers. .TP .BI -k Use the image captions for the HTML slide titles. The default behavior is to use the image names. .TP .BI -m " " Add a watermark to each file. The parameter specified is another image file which will be overlayed in the top left of the image with some transparency applied. This option requires ImageMagick. The original images will be left in place with a '.unmarked' extension. You may wish to delete those afterwards. If this option is specified on two consecutive runs, igal2 will detect the .unmarked versions and not run it through the watermarking process again. Transparent GIF files work well for this option. .TP .BI -n Use the image file names for the HTML slide files. Otherwise the default behavior is to simply name your slides .IR 1.html ", " 2.html ", " and so on. .TP .BI -o " " Use this option if you are hosting the index files in a different location (e.g. a different server) from the back end images/slides. This option adds the specified prefix into the URLs of the slides. If you use this option, remember that until you move the files into the resulting location, the gallery won't work properly. .TP .BI -p " " The cellpadding value of the thumbnail index tables. The default is 3. .TP .BI -r Omit the film reel effect altogether. For a simpler look you can also set the thumbnail background to be the same as the main index page background with the tile background-color option in the .IR igal2.css " file." .TP .B -s For the simplest setup, omit all HTML slides. Clicking the thumbnails on the main page will just take users to the plain image files. .TP .BI -t " " Height (in pixels) of the tiled image used to simulate the top and bottom "film reel" effect on the thumbnail index page. This is 21 for the default .I .tile.png image used, but you should set it otherwise if you replace that file with your own design. .TP .BI -u Write image captions under each thumbnail on the index page. If you have a .I .captions file (see options -c or -C) then the captions are read from there, else the file names are used (but the file extension is stripped). .TP .BI --pagination " " Maximum number of images on one page. If the given number of images is reached a new page is started. Pagination number n should be a multiple of parameter -w (default 5). Default 0 - means no pagination at all. .TP .BI -w " " Set the thumbnail rows to be .I images wide in the main index file. Default is 5. .TP .BI -x Omit the image count from the captions. .TP .BI -y " " Scale all thumbnails to the same height of .IR " pixels." The default is 75 pixels. .TP .BI --xy " " Scale thumbnails to .I pixels along their longest dimension. This value is passed to .B pnmscale and only works properly for .I jpg images. .TP .BI --www Make all .B igal2 files world-readable. .TP .BI --dest " " Per default igal2 places all igal2 helper files (thumbnails, slidefiles, CSS, etc) in the directory where the image files reside. With this option these files can be placed in a subdirectory of the image directory. .TP .BI --AddSubdir If igal2 finds subdirectories below your image directory it will add links to this directories in the index.html file. This is useful if you've a tree of image directories. Example: ! + Vacation_Vienna (Image Directory) ! + .igal2-stuff (igal2 helper files) + Videos + Documents_of_interest igal2 -d Vacation_Vienna --dest .igal2-stuff --AddSubdir will put all helper files in .igal2-stuff, and generate links to the subdirectories "Videos" and "Documents_of_interest" in the index.html file. Note: igal2 will not work recursively, it just adds HREF links to the found directories. .SH FILES .I /usr/local/lib/igal2/indextemplate2.html .RS The default index template file. .RE .I /usr/local/lib/igal2/slidetemplate2.html .RS The default file used to generate slides. .RE .I /usr/local/lib/igal2/igal2.css .RS The default style sheet template. .RE .I /usr/local/lib/igal2/tile.png .RS The tiled image used for the "film reel" effect. .RE .I /usr/local/lib/igal2/directoryline2.html .RS The default file used to generate directory links in index.html. If this file is changed, the index.html has to be regenerated by running igal2 again. .RE All five files are copied to your image directory as dotfiles the first time you run .BR igal2 . Modify the local copies (but keep their names) if you need to further alter the appearance of your slide show (also see .BR "-t" ")." .B igal2 also checks for the existence of a .I "$HOME/.igal2" directory where users can store their own templates, overriding the site-wide .IR "/usr/local/lib/igal2" . .SH EXAMPLES Run .B igal2 in a directory with .IR jpg " or " gif images to see what it does. Then play with the options described above and use .B -h if you need a quick listing. Also see .I http://igal.trexler.at/ for online examples. .SH BUGS There are always some. If you find any let me know. I don't have much time to keep tweaking .B igal2 but if any major bugs pop up I probably ought to fix them. .SH AUTHOR Eric Pop , Wolfgang Trexler .SH "SEE ALSO" .BR cjpeg ", " djpeg ", " pnmscale ", " identify ", " convert ". " If they didn't come standard with your Linux distribution you can find them at .I rpmfind.net (inside libjpeg and libgr-progs) and at .IR "imagemagick.org" , respectively. Also try .I www.ijg.org and .IR "netpbm.sourceforge.net" .