llgal-0.13.17/ 0000755 0001750 0000144 00000000000 11615752214 012322 5 ustar bgoglin users llgal-0.13.17/Makefile 0000644 0001750 0000144 00000007061 11615752214 013766 0 ustar bgoglin users NAME = llgal
ifeq ($(shell [ -d .svn ] && echo 1),1)
VERSION = $(shell cat VERSION)+svn.$(shell date +%Y%m%d)
else
VERSION = $(shell cat VERSION)
endif
DATA_SUBDIR = data
LIB_SUBDIR = lib
PO_SUBDIR = po
DOC_SUBDIR = doc
DESTDIR =
PREFIX = /usr/local
EXEC_PREFIX = $(PREFIX)
BINDIR = $(EXEC_PREFIX)/bin
DATADIR = $(PREFIX)/share
SYSCONFDIR = $(PREFIX)/etc
MANDIR = $(PREFIX)/man
LOCALEDIR = $(DATADIR)/locale
DOCDIR = $(DATADIR)/doc
PERL_INSTALLDIRS =
TARBALL = $(NAME)-$(VERSION)
DEBIAN_TARBALL = $(NAME)_$(VERSION).orig
.PHONY: llgal clean install uninstall tarball
all:: llgal
llgal:: llgal.in VERSION build-lib update-po
sed -e 's!@DATADIR@!$(DESTDIR)$(DATADIR)!g' -e 's!@SYSCONFDIR@!$(DESTDIR)$(SYSCONFDIR)!g' \
-e 's!@LOCALEDIR@!$(DESTDIR)$(LOCALEDIR)!' -e 's!@VERSION@!$(VERSION)!g' \
< llgal.in > llgal
chmod 755 llgal
clean:: clean-lib clean-po
rm -f llgal
install:: install-lib install-po
install -d -m 0755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(DATADIR)/llgal/ $(DESTDIR)$(SYSCONFDIR)/llgal/
install -m 0755 llgal $(DESTDIR)$(BINDIR)/llgal
install -m 0644 $(DATA_SUBDIR)/* $(DESTDIR)$(DATADIR)/llgal/
uninstall:: uninstall-lib uninstall-po
rm $(DESTDIR)$(BINDIR)/llgal
rm -rf $(DESTDIR)$(DATADIR)/llgal/
rmdir $(DESTDIR)$(SYSCONFDIR)/llgal/ || true
tarball::
mkdir /tmp/$(TARBALL)/
cp llgal.in /tmp/$(TARBALL)
cp llgal.1 llgalrc.5 /tmp/$(TARBALL)
cp Makefile /tmp/$(TARBALL)
cp Changes /tmp/$(TARBALL)
cp COPYING README VERSION /tmp/$(TARBALL)
cp -a $(DOC_SUBDIR)/ /tmp/$(TARBALL)
cp -a $(DATA_SUBDIR)/ /tmp/$(TARBALL)
cp -a $(LIB_SUBDIR) /tmp/$(TARBALL)
mkdir /tmp/$(TARBALL)/$(PO_SUBDIR)/
cp $(PO_SUBDIR)/Makefile /tmp/$(TARBALL)/$(PO_SUBDIR)/
cp $(PO_SUBDIR)/*.po /tmp/$(TARBALL)/$(PO_SUBDIR)/
cd /tmp && tar cfz $(DEBIAN_TARBALL).tar.gz $(TARBALL)
cd /tmp && tar cfj $(TARBALL).tar.bz2 $(TARBALL)
mv /tmp/$(DEBIAN_TARBALL).tar.gz /tmp/$(TARBALL).tar.bz2 ..
rm -rf /tmp/$(TARBALL)
# Perl modules
.PHONY: build-lib clean-lib install-lib uninstall-lib prepare-lib
$(LIB_SUBDIR)/Makefile.PL: $(LIB_SUBDIR)/Makefile.PL.in VERSION
sed -e 's!@VERSION@!$(VERSION)!g' < $(LIB_SUBDIR)/Makefile.PL.in > $(LIB_SUBDIR)/Makefile.PL
$(LIB_SUBDIR)/Makefile: $(LIB_SUBDIR)/Makefile.PL
cd $(LIB_SUBDIR) && perl Makefile.PL INSTALLDIRS=$(PERL_INSTALLDIRS)
prepare-lib: $(LIB_SUBDIR)/Makefile
build-lib: prepare-lib
$(MAKE) -C $(LIB_SUBDIR)
install-lib: prepare-lib
$(MAKE) -C $(LIB_SUBDIR) install PREFIX= SITEPREFIX=$(PREFIX) PERLPREFIX=$(PREFIX) VENDORPREFIX=$(PREFIX)
clean-lib: prepare-lib
$(MAKE) -C $(LIB_SUBDIR) distclean
rm $(LIB_SUBDIR)/Makefile.PL
uninstall-lib: prepare-lib
$(MAKE) -C $(LIB_SUBDIR) uninstall
# PO files
.PHONY: update-po clean-po install-po uninstall-po
update-po:
$(MAKE) -C $(PO_SUBDIR) update
clean-po:
$(MAKE) -C $(PO_SUBDIR) clean
install-po:
$(MAKE) -C $(PO_SUBDIR) install LOCALEDIR=$(DESTDIR)$(LOCALEDIR)
uninstall-po:
$(MAKE) -C $(PO_SUBDIR) uninstall LOCALEDIR=$(DESTDIR)$(LOCALEDIR)
# Install the doc, only called on-demand by distrib-specific Makefile
.PHONY: install-doc uninstall-doc
install-doc:
$(MAKE) -C $(DOC_SUBDIR) install DOCDIR=$(DESTDIR)$(DOCDIR)
uninstall-doc:
$(MAKE) -C $(DOC_SUBDIR) uninstall DOCDIR=$(DESTDIR)$(DOCDIR)
# Install the manpages, only called on-demand by distrib-specific Makefile
.PHONY: install-man uninstall-man
install-man::
install -d -m 0755 $(DESTDIR)$(MANDIR)/man1/ $(DESTDIR)$(MANDIR)/man5/
install -m 0644 llgal.1 $(DESTDIR)$(MANDIR)/man1/
install -m 0644 llgalrc.5 $(DESTDIR)$(MANDIR)/man5/
uninstall-man::
rm $(DESTDIR)$(MANDIR)/man1/llgal.1
rm $(DESTDIR)$(MANDIR)/man5/llgalrc.5
llgal-0.13.17/lib/ 0002755 0001750 0000144 00000000000 11615752213 013071 5 ustar bgoglin users llgal-0.13.17/lib/Llgal/ 0002755 0001750 0000144 00000000000 11615752213 014124 5 ustar bgoglin users llgal-0.13.17/lib/Llgal/Config.pm 0000644 0001750 0000144 00000130163 11615751417 015676 0 ustar bgoglin users package Llgal::Config ;
use strict ;
require Llgal::Messages ;
require Llgal::Utils ;
use Getopt::Long ;
use I18N::Langinfo qw(langinfo CODESET) ;
use Locale::gettext ;
use POSIX qw(strftime) ;
use Text::ParseWords ;
######################################################################
# default values that will be restored if the associated option is set to -1
my $index_cellpadding_default = 3 ;
my $pixels_per_row_default = 0 ; # unlimited
my $thumbnail_width_max_default = 113 ;
my $thumbnail_height_max_default = 75 ;
my $thumbnails_per_row_default = 5 ;
my $slide_height_max_default = 0 ; # unlimited
my $slide_width_max_default = 0 ; # unlimited
my $text_slide_width_default = 400 ;
my $text_slide_height_default = 300 ;
######################################################################
# early cmdline parsing
sub early_parse_cmdline_options {
my $self = shift ;
Getopt::Long::Configure('passthrough') ;
GetOptions(
'd=s' => \$self->{destination_dir},
) ;
# restore default behavior: process all options and warn on error
Getopt::Long::Configure('nopassthrough') ;
}
######################################################################
# gettext strings are prefixed to distinguish between identical strings
sub init_llgal_gettext {
my $self = shift ;
textdomain ("llgal") ;
bindtextdomain ("llgal", $self->{locale_dir}) ;
}
sub llgal_gettext {
my $id = shift ;
my $string = gettext ($id) ;
$string =~ s/^[^|]+\|// ;
return $string ;
}
######################################################################
# configuration variables characteristics
# normal option characteristics
my $OPT_IS_NUMERIC = 1 ;
my $OPT_IS_STRING = 2 ;
my $OPT_IS_NONEMPTY_STRING = 3 ;
my $normal_opts_type = {
# Name of generic llgal files
captions_header_filename => $OPT_IS_NONEMPTY_STRING,
css_filename => $OPT_IS_NONEMPTY_STRING,
filmtile_filename => $OPT_IS_NONEMPTY_STRING,
index_link_image_filename => $OPT_IS_NONEMPTY_STRING,
prev_slide_link_image_filename => $OPT_IS_NONEMPTY_STRING,
next_slide_link_image_filename => $OPT_IS_NONEMPTY_STRING,
indextemplate_filename => $OPT_IS_NONEMPTY_STRING,
slidetemplate_filename => $OPT_IS_NONEMPTY_STRING,
# location of generic llgal files that are available on the web
css_location => $OPT_IS_STRING,
filmtile_location => $OPT_IS_STRING,
index_link_image_location => $OPT_IS_STRING,
prev_slide_link_image_location => $OPT_IS_STRING,
next_slide_link_image_location => $OPT_IS_STRING,
# Location and name of generated files
index_filename => $OPT_IS_NONEMPTY_STRING,
slide_filenameprefix => $OPT_IS_STRING,
scaled_image_filenameprefix => $OPT_IS_NONEMPTY_STRING,
thumbnail_image_filenameprefix => $OPT_IS_NONEMPTY_STRING,
captions_filename => $OPT_IS_NONEMPTY_STRING,
user_scaled_image_filenameprefix => $OPT_IS_NONEMPTY_STRING,
user_thumbnail_image_filenameprefix => $OPT_IS_NONEMPTY_STRING,
path_separator_replacement => $OPT_IS_NONEMPTY_STRING,
# Index
index_cellpadding => $OPT_IS_NUMERIC, # >= 0, -1 for default
list_links => $OPT_IS_NUMERIC,
pixels_per_row => $OPT_IS_NUMERIC, # > 0, 0 for unlimited, -1 for default
thumbnails_per_row => $OPT_IS_NUMERIC, # > 0, 0 for unlimited, -1 for default
thumbnail_height_max => $OPT_IS_NUMERIC, # > 0, -1 for default
thumbnail_width_max => $OPT_IS_NUMERIC, # > 0, 0 for unlimited, -1 for default
show_caption_under_thumbnails => $OPT_IS_NUMERIC,
show_film_effect => $OPT_IS_NUMERIC,
MVI_link_to_target => $OPT_IS_NUMERIC,
FIL_link_to_target => $OPT_IS_NUMERIC,
DIR_link_to_target => $OPT_IS_NUMERIC,
LNK_link_to_target => $OPT_IS_NUMERIC,
# Slides
make_no_slides => $OPT_IS_NUMERIC,
make_slide_filename_from_filename => $OPT_IS_NUMERIC,
make_slide_filename_from_extension => $OPT_IS_NUMERIC,
slide_dimensions_from_css => $OPT_IS_NUMERIC,
slide_width_max => $OPT_IS_NUMERIC, # > 0, 0 for unlimited, -1 for default
slide_height_max => $OPT_IS_NUMERIC, # > 0, 0 for unlimited, -1 for default
text_slide_width => $OPT_IS_NUMERIC, # > 0, -1 for default
text_slide_height => $OPT_IS_NUMERIC, # > 0, -1 for default
index_link_image => $OPT_IS_NUMERIC,
prev_slide_link_image => $OPT_IS_NUMERIC,
next_slide_link_image => $OPT_IS_NUMERIC,
prev_slide_link_preview => $OPT_IS_NUMERIC,
next_slide_link_preview => $OPT_IS_NUMERIC,
link_between_last_and_first => $OPT_IS_NUMERIC,
make_slide_title_from_caption => $OPT_IS_NUMERIC,
show_all_exif_tags => $OPT_IS_NUMERIC,
slide_link_to_full_image => $OPT_IS_NUMERIC,
# Captions
captions_removal_line => $OPT_IS_NONEMPTY_STRING,
make_caption_from_image_comment => $OPT_IS_STRING,
make_caption_from_image_timestamp => $OPT_IS_NUMERIC,
make_caption_from_filename => $OPT_IS_NUMERIC,
make_caption_from_extension => $OPT_IS_NUMERIC,
show_dimensions => $OPT_IS_NUMERIC,
show_size => $OPT_IS_NUMERIC,
slide_counter_format => $OPT_IS_STRING,
# Text
index_title_default => $OPT_IS_STRING,
index_link_text => $OPT_IS_NONEMPTY_STRING,
parent_gallery_link_text => $OPT_IS_NONEMPTY_STRING,
prev_gallery_link_text => $OPT_IS_STRING,
next_gallery_link_text => $OPT_IS_STRING,
prev_slide_link_text => $OPT_IS_NONEMPTY_STRING,
next_slide_link_text => $OPT_IS_NONEMPTY_STRING,
MVI_link_text => $OPT_IS_STRING,
FIL_link_text => $OPT_IS_STRING,
DIR_link_text => $OPT_IS_STRING,
alt_full_text => $OPT_IS_STRING,
alt_scaled_text => $OPT_IS_STRING,
alt_thumbnail_text => $OPT_IS_STRING,
alt_film_tile_text => $OPT_IS_STRING,
over_scaled_text => $OPT_IS_STRING,
over_thumbnail_text => $OPT_IS_STRING,
over_index_link_text => $OPT_IS_STRING,
over_prev_slide_link_text => $OPT_IS_STRING,
over_next_slide_link_text => $OPT_IS_STRING,
show_size_unit => $OPT_IS_STRING,
timestamp_format_in_caption => $OPT_IS_NONEMPTY_STRING,
credits_text => $OPT_IS_STRING,
# What files to insert
image_extensions => $OPT_IS_STRING,
movie_extensions => $OPT_IS_STRING,
add_all_files => $OPT_IS_NUMERIC,
add_subdirs => $OPT_IS_NUMERIC,
sort_criteria => $OPT_IS_NONEMPTY_STRING,
# Sections
entitle_sections => $OPT_IS_NUMERIC,
separate_sections => $OPT_IS_NUMERIC,
recursive_sections => $OPT_IS_NUMERIC,
# Recursion
parent_gallery_link => $OPT_IS_NUMERIC,
link_subgalleries => $OPT_IS_NUMERIC,
# Various
codeset => $OPT_IS_STRING,
language => $OPT_IS_STRING,
scaled_create_command => $OPT_IS_STRING,
thumbnail_create_command => $OPT_IS_STRING,
force_image_regeneration => $OPT_IS_NUMERIC,
recursive => $OPT_IS_NUMERIC,
www_access_rights => $OPT_IS_NUMERIC,
www_extension => $OPT_IS_NONEMPTY_STRING,
} ;
# options whose input or output is non-trivial:
# options that have a special parsing routine
my $special_opts_with_input = {
local_llgal_dir => 1,
exclude => 1,
include => 1,
additional_configuration_file => 1,
additional_template_dir => 1,
show_exif_tags => 1,
section_dir => 1,
verbose => 1,
} ;
# internal options that have a special outputting routine
my $special_opts_with_output = {
excludes => 1,
template_dirs => 1,
show_exif_tags => 1,
section_dirs => 1,
} ;
# stuff that is not stored in the option hash but need be outputted
my $special_nonopts_with_output = {
local_llgal_dir => 1,
verbose => 1,
} ;
# internal options that are never output
my $special_opts_without_output = {
default_thumb_xdim => 1,
default_thumb_ydim => 1,
} ;
# options whose merging is done as array
my $special_opts_merging_as_array = {
excludes => 1,
template_dirs => 1,
} ;
######################################################################
# manage configuration variables
# overwrite current_opts (1st argument) with overwriting_opts (2nd)
sub merge_opts {
my $current_opts = shift ;
my $overwriting_opts = shift ;
foreach my $key (keys %{$overwriting_opts}) {
if (defined $overwriting_opts->{$key}) {
if (defined $special_opts_merging_as_array->{$key}
and defined $current_opts->{$key}) {
$current_opts->{$key} = [@{$current_opts->{$key}}, @{$overwriting_opts->{$key}}] ;
} else {
$current_opts->{$key} = $overwriting_opts->{$key}
}
}
}
}
# overwrite current_opts with overwriting_opts in a new hash, without changing the originals
sub merge_opts_into {
my $current_opts = shift ;
my $overwriting_opts = shift ;
my $new_opts = {} ;
merge_opts ($new_opts, $current_opts) ;
merge_opts ($new_opts, $overwriting_opts) ;
return $new_opts ;
}
# set default to all uninitialized options
sub add_defaults {
my $current_opts = shift ;
my $default_opts = {
# Name of generic llgal files
captions_header_filename => "captions.header",
css_filename => "llgal.css",
filmtile_filename => "tile.png",
index_link_image_filename => "index.png",
prev_slide_link_image_filename => "prev.png",
next_slide_link_image_filename => "next.png",
indextemplate_filename => "indextemplate.html",
slidetemplate_filename => "slidetemplate.html",
# Location of llgal files if already on the web
css_location => "",
filmtile_location => "",
index_link_image_location => "",
prev_slide_link_image_location => "",
next_slide_link_image_location => "",
# Location and name of generated files
# name of the index file (-i)
index_filename => "index",
# prefix of HTML slide filenames
slide_filenameprefix => "slide_",
# scaled and thumbnail image filename prefix
scaled_image_filenameprefix => "scaled_",
thumbnail_image_filenameprefix => "thumb_",
# captions filename
captions_filename => "captions",
# additional prefix of user-provided scaled images
user_scaled_image_filenameprefix => "my",
# additional prefix of user-provided thumbnails
user_thumbnail_image_filenameprefix => "my",
# character to use to replace / in the thumbnail/scaled of subdir images
path_separator_replacement => "@",
# Index
# cellpadding value for the thumbnail index tables (-p)
index_cellpadding => $index_cellpadding_default,
# list links outside f the table (-L)
list_links => 0,
# how many pixels per row at most in index (--wx)
pixels_per_row => $pixels_per_row_default,
# how many thumbnails per row at most in index (-w)
thumbnails_per_row => $thumbnails_per_row_default,
# max height of a thumbnail (--ty)
thumbnail_height_max => $thumbnail_height_max_default,
# scale thumb longer dimension (--tx)
thumbnail_width_max => $thumbnail_width_max_default,
# write captions under thumbnails on index page (-u)
show_caption_under_thumbnails => 0,
# show the film effect in the index of thumbnails (--fe)
show_film_effect => 0,
# link thumbnails to target instead of slide
MVI_link_to_target => 0,
FIL_link_to_target => 0,
DIR_link_to_target => 0,
LNK_link_to_target => 0,
# Slides
# make no slides, just thumbnail links to images (-s)
make_no_slides => 0,
# use image names as slide names (-n)
make_slide_filename_from_filename => 0,
# also use image extension in the slide names
make_slide_filename_from_extension => 0,
# do not output dimensions for slides, let the css do it
slide_dimensions_from_css => 0,
# max width of the slides (--sx)
slide_width_max => $slide_width_max_default,
# max height of the slides (--sy)
slide_height_max => $slide_height_max_default,
# default text slide width
text_slide_width => $text_slide_width_default,
# default text slide height
text_slide_height => $text_slide_height_default,
# use an image for link from a slide to the index, previous or next slide
index_link_image => 0,
prev_slide_link_image => 0,
next_slide_link_image => 0,
# use an image preview for link from a slide to the previous or next slide
prev_slide_link_preview => 0,
next_slide_link_preview => 0,
# do not link between last and first slides or galleries
link_between_last_and_first => 1,
# use captions as slide titles (-k)
make_slide_title_from_caption => 0,
# show a table of exif tags
show_exif_tags => [],
# link scaled to full
slide_link_to_full_image => 1,
# Captions
# this line will be placed in caption generated file
# the user may remove it to prevent llgal from removing the caption file with --clean
captions_removal_line => "REMOVE THIS LINE IF LLGAL SHOULD NOT REMOVE THIS FILE",
# use image comment as captions (--cc)
make_caption_from_image_comment => 0,
# use image timestamp as captions (--ct)
make_caption_from_image_timestamp => 0,
# preserve image names as captions (--cf)
make_caption_from_filename => 0,
# to write image dimensions (-a or --ad)
show_dimensions => 0,
# to write image size (-a or --as)
show_size => 0,
# omit the image slide from the caption (--nc)
slide_counter_format => " (%0n/%t)",
# Text
# title of the gallery (--title)
index_title_default => llgal_gettext ("index_title|Index of pictures"),
# label of link to the parent gallery
parent_gallery_link_text => llgal_gettext ("parent_gallery_link_text|Back to parent gallery"),
# label of link to previous gallery
prev_gallery_link_text => llgal_gettext ("prev_gallery_link_text|Previous gallery "),
# label of link to previous gallery
next_gallery_link_text => llgal_gettext ("next_gallery_link_text|Next gallery "),
# label of link from slides to index
index_link_text => llgal_gettext ("index_link_text|Index"),
# label of link from a slide to the previous one
prev_slide_link_text => llgal_gettext ("prev_slide_link_text|<<Prev"),
# label of link from a slide to the next one
next_slide_link_text => llgal_gettext ("next_slide_link_text|Next>>"),
# label of text inserted as a section title
section_text => llgal_gettext ("section_text|Section "),
# text prefixing the link text
MVI_link_text => llgal_gettext ("MVI_link_text|Open movie "),
FIL_link_text => llgal_gettext ("FIL_link_text|Download file "),
DIR_link_text => llgal_gettext ("DIR_link_text|Open subgallery "),
# alternative text for full-size images in slides
alt_full_text => llgal_gettext ("alt_full_text|"),
# alternative text for scaled images in slides
alt_scaled_text => llgal_gettext ("alt_scaled_text|Scaled image "),
# alternative text for thumbnails in the index
alt_thumbnail_text => llgal_gettext ("alt_thumbnail_text|Thumbnail "),
# alternative text for film tile
alt_film_tile_text => llgal_gettext ("alt_film_tile_text|Film Tile"),
# text shown when the mouse pointer is over a scaled image in a slide
over_scaled_text => llgal_gettext ("over_scaled_text|Click to see full size "),
# text shown when the mouse pointer is over a thumbnail
over_thumbnail_text => llgal_gettext ("over_thumbnail_text|Click to enlarge "),
# text shown when the mouse pointer is over a link to the index
over_index_link_text => llgal_gettext ("over_index_link_text|Return to the index"),
# text shown when the mouse pointer is over a link to the previous slide
over_prev_slide_link_text => llgal_gettext ("over_prev_slide_link_text|Previous slide "),
# text shown when the mouse pointer is over a link to the next slide
over_next_slide_link_text => llgal_gettext ("over_next_slide_link_text|Next slide "),
# change kB to another unit (--asu)
show_size_unit => llgal_gettext ("show_size_unit|kB"),
# format of the timestamp in captions, when enabled (--ct)
timestamp_format_in_caption => llgal_gettext ("timestamp_format_in_caption|%y-%m-%d %H:%M:%S"),
# credits line at the bottom of the index
credits_text => llgal_gettext ("credits_text|created with llgal"),
# What files to insert in the gallery
# image and movie extensions
image_extensions => "jpg|jpeg|png|gif|tif|tiff|bmp",
movie_extensions => "mpg|mpeg|avi|mov|ogm|wmv",
# add all files, not only images and movies (-A)
add_all_files => 0,
# add subdirectories to entry list (-S)
add_subdirs => 0,
# exclude/include
excludes => [],
# sort criteria
sort_criteria => "name",
# Sections
# section directories
section_dirs => [],
# do we add a text slide to entitle sections
entitle_sections => 0,
# do we separate sections in the gallery
separate_sections => 0,
# do we create sections for all subdirectories
recursive_sections => 0,
# Recursion
# add links between subgalleries
link_subgalleries => 0,
# generate header and footer for link to parent gallery
parent_gallery_link => 0,
# Various
# codeset to be set in HTML headers (--codeset)
codeset => langinfo (CODESET ()),
# language to be used for generated text in HTML pages (--lang)
# default is actually useless since we set it before reading the defaults
language => "",
# user-added directories where templates might be found
template_dirs => [],
# commands to generate thumbnails and scaled images
scaled_create_command => "convert -scale x",
thumbnail_create_command => "convert -scale x",
# force thumbnails and scaled images regeneration
force_image_regeneration => 0,
# makes everything world-readable (--www)
www_access_rights => 0,
# extension of generate webpages (--php)
www_extension => "html",
} ;
# merge given options _into_ defaults
merge_opts ($default_opts, $current_opts) ;
return $default_opts ;
}
######################################################################
# Create usage now to use defaults values
sub die_usage {
my $self = shift ;
my $usage = << "END_OF_USAGE" ;
This is llgal $self->{version}, the image slide show generator.
Syntax: llgal [-option -option ...]
Behavior Options:
llgal generates a gallery, except with one of the following options:
--clean remove all generated files
--cleanall remove all generated and user modified files
--gc generate or update the captions file
--gt [] give templates to the directory
-h, --help display this brief help
-v, --verbose display notice messages
-V, --version show version
Additional Behavior Options:
The behavior might also be modified with the following options,
either when generating a gallery or not:
--config pass an additional configuration files
-d operate in directory (current directory)
-f force thumbnail and scaled slide regeneration
--gencfg generate the configuration file
--option pass an additional option as in configuration files
-R run recursively in subdirectories
Selecting files:
-A add all non-image non-video files to the list of slides
--exclude exclude matching files
--include include matching files that were excluded
-P add a section with images in subdirectory
--Pall add sections and images from all subdirectories
--Ps separate sections in the index with a line and a title
-S add subdirectories to the list of slides
Layout Options:
-a write image sizes under thumbnails on index page
--ad like -a, but write only the image dimensions
--as like -a, but write only the file size
--asu change file size unit (kB)
--cc [] use image comments as captions
--cf use file names as captions
--ct [] use image timestamps as captions
--codeset change the codeset in HTML pages
--exif [] show exif tags on each slide
--fe show a film effect in the indexof thumbnails
-i name of the main thumbnail index file (index)
-k use the image captions for the HTML slide titles
-L list links outside of the table
--lang change the locale
--li use images for links in slides
--lt use thumbnail preview for links in slides
-n use image file names for the HTML slide files
--nc omit the image count from the captions
--nf omit the link from slides' scaled images to full unscaled
-p cellpadding value of thumbnail index tables (3)
--parent-gal add links to the parent gallery
--php use php extension for generated webpages
--Rl add links between subgalleries
-s make no HTML slides, link thumbnails to images
--sort sort files with criteria
--templates use templates in
--title title of the index of the gallery (Index of pictures)
--sx limit image width in slides to pixels
--sy limit image height in slides to pixels
--tx limit thumbnail width to pixels (113)
--ty limit thumbnail height to pixels (75)
-u write captions under thumbnails on index page
--uc use a CSS file that is already available on the web
--ui use filmtile and link images that are already available on the web
-w rows in thumbnail index are at most images wide (5)
--www make all llgal files world-readable
--wx rows in thumbnail index are at most pixels wide
Default values are given in parentheses (where applicable).
Author: Brice Goglin
Homepage: http://home.gna.org/llgal
Report bugs to:
END_OF_USAGE
die $usage ;
}
######################################################################
# do not show usage when dying from inside Getoptions
my $no_usage_on_getoptions_error = 0 ;
######################################################################
# parse options in config files
# forward declaration
sub parse_custom_config_file ;
# option parsing global variables
my $recursive_included_configuration_file = 0 ;
my $current_configuration_file = undef ;
# in case of option parsing error
sub process_option_error {
my $error = shift ;
$no_usage_on_getoptions_error = 1 ;
if (defined $current_configuration_file) {
my $file = $current_configuration_file ;
$current_configuration_file = undef ; # reset here since we won't be able to reset anywhere else
die "Line #$. of $file:\n $error.\n" ;
} else {
die "$error.\n" ;
}
}
# process one option line
sub process_option {
my $self = shift ;
my $opts = shift ;
my $messages = $self->{messages} ;
my $line = shift ;
chomp $line ;
if ($line =~ m/^([^ ]+)\s*=.+$/) {
my $optname = $1 ;
my $type = $normal_opts_type->{$optname} ;
if (defined $type) {
# use the options type to choose parsing
if ($type == $OPT_IS_NUMERIC) {
# any match is fine
if ($line =~ m/^[^ ]+\s*=\s*(\d+)$/) {
$opts->{$optname} = $1 ;
} else {
process_option_error "Configuration option <$optname> value must be numeric (in <$line>)" ;
}
} elsif ($type == $OPT_IS_STRING) {
# value must be quoted
if ($line =~ m/^[^ ]+\s*=\s*"(.*)"$/) {
$opts->{$optname} = $1 ;
} else {
process_option_error "Configuration option <$optname> value must be a string (in <$line>)" ;
}
} elsif ($type == $OPT_IS_NONEMPTY_STRING) {
# value must be quoted and non-empty
if ($line =~ m/^[^ ]+\s*=\s*"(.+)"$/) {
$opts->{$optname} = $1 ;
} else {
process_option_error "Configuration option <$optname> value must be a non-empty string (in <$line>)" ;
}
}
} elsif ($special_opts_with_input->{$optname}) {
# not a normal option, must be special
if ($line =~ m/^local_llgal_dir\s*=\s*"(.*)"$/) {
# the local llgal directory name may only be changed
# during early configuration
if ($self->{early_configuration}) {
$self->{local_llgal_dir} = $1 ;
} elsif ($1 ne $self->{local_llgal_dir}) {
$messages->warning ("Ignoring changes to the name of the local llgal directory outside of") ;
$messages->warning ("system- and user-wide configuration files.") ;
}
} elsif ($line =~ m/^exclude\s*=\s*"(.+)"$/) {
my $entry = () ;
$entry->{excluded} = 1 ;
$entry->{filter} = $1 ;
push (@{$opts->{excludes}}, $entry) ;
} elsif ($line =~ m/^exclude\s*=\s*"(.+)"$/) {
my $entry = () ;
$entry->{excluded} = 0 ;
$entry->{filter} = $1 ;
push (@{$opts->{excludes}}, $entry) ;
} elsif ($line =~ m/^additional_configuration_file\s*=\s*"(.+)"$/) {
my $file = $1 ;
if ($recursive_included_configuration_file++ >= 10) {
$no_usage_on_getoptions_error = 1 ;
die "Not opening '$file' since too much configuration files were recursively included, loop detected ?\n" ;
}
my $saved_current_configuration_file = $current_configuration_file ;
parse_custom_config_file $self, $opts, $file ;
$current_configuration_file = $saved_current_configuration_file ;
$recursive_included_configuration_file-- ;
} elsif ($line =~ m/^additional_template_dir\s*=\s*"(.+)"$/) {
push (@{$opts->{template_dirs}}, $1) ;
} elsif ($line =~ m/^show_exif_tags\s*=\s*"(.*)"$/) {
push (@{$opts->{show_exif_tags}}, split (/,/, $1));
} elsif ($line =~ m/^section_dir\s*=\s*"(.+)"$/) {
push (@{$opts->{section_dirs}}, $1) ;
} elsif ($line =~ m/^verbose\s*=\s*(\d+)$/) {
$messages->{verbose} = $1 ;
} else {
process_option_error "Unrecognized configuration option line <$line>" ;
}
} else {
process_option_error "Unknown configuration option <$optname>" ;
}
} else {
process_option_error "Configuration must be given = (was $line)" ;
}
return $opts ;
}
sub parse_generic_config_file {
my $self = shift ;
my $messages = $self->{messages} ;
my $opts = {} ;
my $file = shift ;
# TODO: remove this one day (maybe on march 14th 2006, since it will be 6 month ?)
# warn on obsolete file
my $oldconffile = $file ;
$oldconffile =~ s@$self->{local_llgal_dir}/llgalrc$@.llgalrc@ ;
$oldconffile =~ s@llgal/llgalrc$@llgalrc@ ;
$messages->warning ("Obsolete configuration file $oldconffile skipped, should be moved to $file.")
if -e $oldconffile ;
# generic configuration files may not exist
if (open CONF, $file) {
$current_configuration_file = $file ;
while () {
process_option $self, $opts, $_
if (/^[^#]/ and !/^(\s*)$/) ;
}
$current_configuration_file = undef ;
close CONF ;
}
return $opts ;
}
sub parse_custom_config_file {
my $self = shift ;
my $opts = shift ;
my $file = shift ;
my $messages = $self->{messages} ;
# don't use a capitalized file handle since it would be shared across recursive calls
if (open my $conf, $file) {
$messages->notice ("Reading additional configuration file '$file'...\n");
$current_configuration_file = $file ;
while (<$conf>) {
process_option $self, $opts, $_
if (/^[^#]/ and !/^(\s*)$/) ;
}
$current_configuration_file = undef ;
close $conf ;
} else {
# custom configuration files have to exist
$no_usage_on_getoptions_error = 1 ;
die "Failed to open additional configuration file '$file' ($!).\n" ;
}
}
######################################################################
# process command-line arguments (overriding defaults above)
sub parse_cmdline_options {
my $self = shift ;
my $opts = {} ;
if (!GetOptions(
# behaviors
'clean' => \$self->{clean_asked},
'cleanall' => \$self->{cleanall_asked},
'gc' => \$self->{generate_captions},
'gt:s' => sub {
shift ; my $value = shift ;
$value = "local" if !$value ;
$self->{give_templates} = $value ;
},
'v|verbose' => \$self->{messages}->{verbose},
'h|help' => \$self->{help_asked},
'V|version' => \$self->{version_asked},
'f' => \$opts->{force_image_regeneration},
'gencfg=s' => \$self->{generate_config},
'config=s' => sub { shift ; parse_custom_config_file $self, $opts, shift ; },
'R' => \$opts->{recursive},
# layout
'A' => \$opts->{add_all_files},
'a' => sub { $opts->{show_dimensions} = $opts->{show_size} = 1 ; },
'ad' => \$opts->{show_dimensions},
'as' => \$opts->{show_size},
'asu=s' => \$opts->{show_size_unit},
'cc:s' => sub {
shift ; my $value = shift ;
if ($value eq "") { $opts->{make_caption_from_image_comment} = "std,exif" ; }
elsif ($value eq "0") { $opts->{make_caption_from_image_comment} = "" ; }
else { $opts->{make_caption_from_image_comment} = $value ; }
},
'cf' => \$opts->{make_caption_from_filename},
'ct:s' => sub {
shift ; my $value = shift ;
$opts->{make_caption_from_image_timestamp} = 1 ;
if ($value ne "") { $opts->{timestamp_format_in_caption} = $value ; }
},
'ctf=s' => \$opts->{timestamp_format_in_caption},
'codeset=s' => \$opts->{codeset},
'exif:s' => sub {
shift ; my $value = shift ;
if ($value eq "") { $opts->{show_all_exif_tags} = 1 ; }
else { push (@{$opts->{show_exif_tags}}, split (/,/, $value)) ; }
},
'fe' => \$opts->{show_film_effect},
'i=s' => \$opts->{index_filename},
'k' => \$opts->{make_slide_title_from_caption},
'L' => \$opts->{list_links},
'lang=s' => \$opts->{language},
'li' => sub { $opts->{index_link_image} = 1 ; $opts->{prev_slide_link_image} = 1 ; $opts->{next_slide_link_image} = 1 ; },
'lt' => sub { $opts->{prev_slide_link_preview} = 1 ; $opts->{next_slide_link_preview} = 1 ; },
'n' => \$opts->{make_slide_filename_from_filename},
'nc' => sub { $opts->{slide_counter_format} = "" ; },
'nf' => sub { $opts->{slide_link_to_full_image} = 0 ; },
'option=s' => sub { shift ; process_option $self, $opts, shift ; },
'P=s' => \@{$opts->{section_dirs}},
'Pall' => \$opts->{recursive_sections},
'Ps' => sub { $opts->{entitle_sections} = 1 ; $opts->{separate_sections} = 1 ; },
'p=i' => \$opts->{index_cellpadding},
'php' => sub { $opts->{www_extension} = "php" ; },
'Rl' => \$opts->{link_subgalleries},
'S' => \$opts->{add_subdirs},
's' => \$opts->{make_no_slides},
'sort=s' => \$opts->{sort_criteria},
'templates=s' => \@{$opts->{template_dirs}},
'title=s' => \$opts->{index_title},
'sx=i' => \$opts->{slide_width_max},
'sy=i' => \$opts->{slide_height_max},
'tx=i' => \$opts->{thumbnail_width_max},
'ty=i' => \$opts->{thumbnail_height_max},
'u' => \$opts->{show_caption_under_thumbnails},
'uc=s' => \$opts->{css_location},
'ui=s' => sub { shift ; my $url = shift ;
$opts->{filmtile_location} = $url ;
$opts->{index_link_image_location} = $url ;
$opts->{prev_slide_link_image_location} = $url ;
$opts->{next_slide_link_image_location} = $url ;
},
'w=i' => \$opts->{thumbnails_per_row},
'www' => \$opts->{www_access_rights},
'wx=i' => \$opts->{pixels_per_row},
'exclude=s' => sub {
shift ;
my $entry = () ;
$entry->{filter} = shift ;
$entry->{excluded} = 1 ;
push @{$opts->{excludes}}, $entry ;
},
'include=s' => sub {
shift ;
my $entry = () ;
$entry->{filter} = shift ;
$entry->{excluded} = 0 ;
push @{$opts->{excludes}}, $entry ;
},
'parent-gal' => \$opts->{parent_gallery_link},
)) {
# there has been an error during command line parsing
if ($no_usage_on_getoptions_error) {
# the error has already been displayed
exit -1 ;
} else {
die_usage ($self) ;
}
}
return $opts ;
}
######################################################################
# check and defaults
# check whether an argument is an integer
sub is_integer {
my $s = shift ;
return $s eq int($s) ;
}
# various common checks and definitions
sub prepare_common_variables {
my $self = shift ;
my $opts = shift ;
# check a few string that have to be non-empty and may need to be single file without path
die "Please give a non-empty directory name without path as a local llgal directory\n"
if $self->{local_llgal_dir} eq "" or $self->{local_llgal_dir} =~ m@/@ ;
}
# various checks and definitions to process the captions
sub prepare_captions_variables {
my $self = shift ;
my $opts = shift ;
prepare_common_variables $self, $opts ;
# check a few string that have to be non-empty and may need to be single file without path
die "Please give a non-empty filename without path as a caption filename\n"
if $opts->{captions_filename} eq "" or $opts->{captions_filename} =~ m@/@ ;
die "Please give a non-empty caption removal line\n"
if $opts->{captions_removal_line} eq "" ;
}
# various check and definitions to create the gallery
sub prepare_gallery_variables {
my $self = shift ;
my $opts = shift ;
my $messages = $self->{messages} ;
prepare_captions_variables $self, $opts ;
# check a few string that have to be non-empty and may need to be single file without path
die "Please give a non-empty filename without path as a CSS filename\n"
if $opts->{css_filename} eq "" or $opts->{css_filename} =~ m@/@ ;
die "Please give a non-empty filename without path as a film tile filename\n"
if $opts->{filmtile_filename} eq "" or $opts->{filmtile_filename} =~ m@/@ ;
die "Please give a non-empty filename without path as a index link image filename\n"
if $opts->{index_link_image_filename} eq "" or $opts->{index_link_image_filename} =~ m@/@ ;
die "Please give a non-empty filename without path as a previous slide link image filename\n"
if $opts->{prev_slide_link_image_filename} eq "" or $opts->{prev_slide_link_image_filename} =~ m@/@ ;
die "Please give a non-empty filename without path as a next slide link image filename\n"
if $opts->{next_slide_link_image_filename} eq "" or $opts->{next_slide_link_image_filename} =~ m@/@ ;
die "Please give a non-empty filename without path as a index template filename\n"
if $opts->{indextemplate_filename} eq "" or $opts->{indextemplate_filename} =~ m@/@ ;
die "Please give a non-empty filename without path as a slide template filename\n"
if $opts->{slidetemplate_filename} eq "" or $opts->{slidetemplate_filename} =~ m@/@ ;
die "Please give a non-empty string without path as a slide filename prefix\n"
if $opts->{scaled_image_filenameprefix} eq "" or $opts->{scaled_image_filenameprefix} =~ m@/@ ;
die "Please give a non-empty string without path as a thumbnail filename prefix\n"
if $opts->{thumbnail_image_filenameprefix} eq "" or $opts->{thumbnail_image_filenameprefix} =~ m@/@ ;
die "Please give a non-empty filename without path as a index filename\n"
if $opts->{index_filename} eq "" or $opts->{index_filename} =~ m@/@ ;
die "Please give a non-empty string without path as a user-given scaled image prefix\n"
if $opts->{user_scaled_image_filenameprefix} eq "" or $opts->{user_scaled_image_filenameprefix} =~ m@/@ ;
die "Please give a non-empty string without path as a user-given thumbnail image prefix\n"
if $opts->{user_thumbnail_image_filenameprefix} eq "" or $opts->{user_thumbnail_image_filenameprefix} =~ m@/@ ;
# css location
if ($opts->{css_location} =~ m@^(.*/)$@) {
$opts->{css_location} .= $opts->{css_filename} ;
}
# images location
if ($opts->{filmtile_location} =~ m@^(.*)/$@) {
$opts->{filmtile_location} .= $opts->{filmtile_filename} ;
}
if ($opts->{index_link_image_location} =~ m@^(.*/)$@) {
$opts->{index_link_image_location} .= $opts->{index_link_image_filename} ;
}
if ($opts->{prev_slide_link_image_location} =~ m@^(.*/)$@) {
$opts->{prev_slide_link_image_location} .= $opts->{prev_slide_link_image_filename} ;
}
if ($opts->{next_slide_link_image_location} =~ m@^(.*/)$@) {
$opts->{next_slide_link_image_location} .= $opts->{next_slide_link_image_filename} ;
}
# cannot have --sx/sy and -s
die "Please choose between --sx/--sy and -s\n"
if ($opts->{slide_height_max} or $opts->{slide_width_max}) and $opts->{make_no_slides} ;
# thumbnail_width_max must be > 0 or 0 for unlimited
die "Please give an integer value for thumbnail width max\n"
unless is_integer ($opts->{thumbnail_width_max}) ;
if ($opts->{thumbnail_width_max} < 0) {
$messages->notice ("Thumbnail width max value < 0, restoring to default (".
($thumbnail_width_max_default?$thumbnail_width_max_default:"unlimited") .")\n") ;
$opts->{thumbnail_width_max} = $thumbnail_width_max_default ;
}
die "Please give a positive thumbnail width max value (or 0 for unlimited)\n"
unless $opts->{thumbnail_width_max} >= 0 ;
# thumbnail_height_max must be > 0
die "Please give an integer value for thumbnail height max\n"
unless is_integer ($opts->{thumbnail_height_max}) ;
if ($opts->{thumbnail_height_max} < 0) {
$messages->notice ("Thumbnail height max value < 0, restoring to default ($thumbnail_height_max_default)\n") ;
$opts->{thumbnail_height_max} = $thumbnail_height_max_default ;
}
die "Please give a positive thumbnail height max value\n"
unless $opts->{thumbnail_height_max} > 0 ;
# thumbnails_per_row must be > 0 or 0 for unlimited
die "Please give an integer value for thumbnails per row\n"
unless is_integer ($opts->{thumbnails_per_row}) ;
if ($opts->{thumbnails_per_row} < 0) {
$messages->notice ("Thumbnails per row value < 0, restoring to default (".
($thumbnails_per_row_default?$thumbnails_per_row_default:"unlimited") .")\n") ;
$opts->{thumbnails_per_row} = $thumbnails_per_row_default ;
}
die "Please give a positive thumbnails per row value (or 0 for unlimited)\n"
unless $opts->{thumbnails_per_row} >= 0 ;
# pixels_per_row must be > 0 or 0 for unlimited
die "Please give an integer value for pixels per row\n"
unless is_integer ($opts->{pixels_per_row}) ;
if ($opts->{pixels_per_row} < 0) {
$messages->notice ("Pixels per row value < 0, restoring to default (".
($pixels_per_row_default?$pixels_per_row_default:"unlimited") .")\n") ;
$opts->{pixels_per_row} = $pixels_per_row_default ;
}
die "Please give a positive pixels per row value (or 0 for unlimited)\n"
unless $opts->{pixels_per_row} >= 0 ;
# index_cellpadding must be >= 0
die "Please give an integer value for index cellpadding\n"
unless is_integer ($opts->{index_cellpadding}) ;
if ($opts->{index_cellpadding} < 0) {
$messages->notice ("Index cellpadding value < 0, restoring to default ($index_cellpadding_default)\n") ;
$opts->{index_cellpadding} = $index_cellpadding_default ;
}
die "Please give a positive or null index cellpadding value\n"
unless $opts->{index_cellpadding} >= 0 ;
# text_slide_width must be > 0
die "Please give an integer value for text slide width\n"
unless is_integer ($opts->{text_slide_width}) ;
if ($opts->{text_slide_width} < 0) {
$messages->notice ("Text slide width value < 0, restoring to default ($text_slide_width_default)\n") ;
$opts->{text_slide_width} = $text_slide_width_default ;
}
die "Please give a positive text slide width value\n"
unless $opts->{text_slide_width} > 0 ;
# text_slide_height must be > 0
die "Please give an integer value for text slide height\n"
unless is_integer ($opts->{text_slide_height}) ;
if ($opts->{text_slide_height} < 0) {
$messages->notice ("Text slide height value < 0, restoring to default ($text_slide_height_default)\n") ;
$opts->{text_slide_height} = $text_slide_height_default ;
}
die "Please give a positive text slide height value\n"
unless $opts->{text_slide_height} > 0 ;
# slide_width_max must be > 0, 0 for unlimited
die "Please give an integer value for slide width max\n"
unless is_integer ($opts->{slide_width_max}) ;
if ($opts->{slide_width_max} < 0) {
$messages->notice ("Slide width max value < 0, restoring to default (".
($slide_width_max_default?$slide_width_max_default:"unlimited") .")\n") ;
$opts->{slide_width_max} = $slide_width_max_default ;
}
die "Please give a positive slide width max value (or 0 for unlimited)\n"
unless $opts->{slide_width_max} >= 0 ;
# slide_height_max must be > 0, 0 for unlimited
die "Please give an integer value for slide height max\n"
unless is_integer ($opts->{slide_height_max}) ;
if ($opts->{slide_height_max} < 0) {
$messages->notice ("Slide height max value < 0, restoring to default (".
($slide_height_max_default?$slide_height_max_default:"unlimited") .")\n") ;
$opts->{slide_height_max} = $slide_height_max_default ;
}
die "Please give a positive slide height max value (or 0 for unlimited)\n"
unless $opts->{slide_height_max} >= 0 ;
# either pixels or thumbnails per row must be limited
die "Please limit pixels or thumbnails per row\n"
unless $opts->{pixels_per_row} > 0 or $opts->{thumbnails_per_row} > 0 ;
# adapt text slide width and height in case of --sx/sy
if ($opts->{slide_height_max} > 0) {
$opts->{text_slide_width} = $opts->{text_slide_width} / $opts->{text_slide_height} * $opts->{slide_height_max} ;
$opts->{text_slide_height} = $opts->{slide_height_max} ;
}
if ($opts->{slide_width_max} > 0 and $opts->{text_slide_width} > $opts->{slide_width_max}) {
$opts->{text_slide_height} = $opts->{text_slide_height} / $opts->{text_slide_width} * $opts->{slide_width_max} ;
$opts->{text_slide_width} = $opts->{slide_width_max} ;
}
# thumbnail default size (for text and link slide especially)
if ($opts->{thumbnail_width_max} > 0) {
($opts->{default_thumb_xdim}, $opts->{default_thumb_ydim}) = ($opts->{thumbnail_width_max}, $opts->{thumbnail_height_max}) ;
} else {
($opts->{default_thumb_xdim}, $opts->{default_thumb_ydim}) = ($opts->{thumbnail_height_max} * 4/3, $opts->{thumbnail_height_max}) ;
}
# convert options for thumbnails
my $thumb_MAXH = $opts->{thumbnail_height_max} ;
my $thumb_MAXW = $opts->{thumbnail_width_max} > 0 ? $opts->{thumbnail_width_max} : "" ;
$opts->{thumbnail_create_command} =~ s//$thumb_MAXH/g ;
$opts->{thumbnail_create_command} =~ s//$thumb_MAXW/g ;
# convert options for slides
my $scaled_MAXH = $opts->{slide_height_max} > 0 ? $opts->{slide_height_max} : "" ;
my $scaled_MAXW = $opts->{slide_width_max} > 0 ? $opts->{slide_width_max} : "" ;
$opts->{scaled_create_command} =~ s//$scaled_MAXH/g ;
$opts->{scaled_create_command} =~ s//$scaled_MAXW/g ;
}
#######################################################################
# If --gencfg was invoked, generate a configuration file
sub generate_config {
my $self = shift ;
my $file = shift ;
my $opts = shift ;
my $messages = $self->{messages} ;
$messages->print ("Generating config file '$file'.\n") ;
if (-e "$file") {
my $old_file = "$file.save.". (strftime('%Y-%m-%d_%H:%M:%S' ,localtime)) ;
$messages->warning ("Renaming old configuration file '$file' as '$old_file'") ;
rename "$file", "$old_file" ;
}
open NEWCFG, ">$file"
or die "Cannot open $file ($!).\n" ;
print NEWCFG "# This is a llgal configuration file.\n" ;
print NEWCFG "# It was automatically generated on ". (scalar localtime) .".\n" ;
print NEWCFG "# You may modify and reuse it as you want.\n" ;
print NEWCFG "\n" ;
for my $optname (sort (keys %{$normal_opts_type}, keys %{$special_opts_with_output}, keys %{$special_nonopts_with_output})) {
if (defined $special_nonopts_with_output->{$optname}) {
if ($optname eq "local_llgal_dir") {
print NEWCFG "local_llgal_dir = \"$self->{local_llgal_dir}\"\n" ;
} elsif ($optname eq "verbose") {
print NEWCFG "verbose = $messages->{verbose}\n" ;
} else {
die "Unknown non-options $optname to output.\n" ;
}
} elsif (defined $special_opts_with_output->{$optname}) {
next if not defined $opts->{$optname} ;
# special options that need special output
if ($optname eq "show_exif_tags") {
print NEWCFG "show_exif_tags = \"". (join (",", @{$opts->{show_exif_tags}})) ."\"\n" ;
} elsif ($optname eq "template_dirs") {
if (@{$opts->{template_dirs}}) {
map {
print NEWCFG "additional_template_dir = \"$_\"\n" ;
} @{$opts->{template_dirs}} ;
}
} elsif ($optname eq "excludes") {
if (@{$opts->{excludes}}) {
map {
print NEWCFG ($_->{excluded} ? "exclude" : "include"). " = \"". $_->{filter} ."\"\n" ;
} @{$opts->{excludes}} ;
}
} elsif ($optname eq "section_dirs") {
if (@{$opts->{section_dirs}}) {
map {
print NEWCFG "section_dir = \"$_\"\n" ;
} @{$opts->{section_dirs}} ;
}
} else {
die "Unknown special internal option $optname to output.\n" ;
}
} else {
next if not defined $opts->{$optname} ;
# normal options
my $type = $normal_opts_type->{$optname} ;
if (defined $type) {
if ($type == $OPT_IS_NUMERIC) {
print NEWCFG "$optname = $opts->{$optname}\n" ;
} elsif ($type == $OPT_IS_STRING or $type == $OPT_IS_NONEMPTY_STRING) {
print NEWCFG "$optname = \"$opts->{$optname}\"\n" ;
} else {
die "Unknown normal option type $type.\n" ;
}
} else {
die "Unknown ge option $optname to output.\n" ;
}
}
}
print NEWCFG "\n" ;
close NEWCFG ;
}
1 ;
llgal-0.13.17/lib/Llgal/Templates.pm 0000644 0001750 0000144 00000011066 10731006171 016413 0 ustar bgoglin users package Llgal::Templates ;
use strict ;
use File::Copy ;
use Llgal::Utils ;
# copy a file
sub copy_file {
my $self = shift ;
my $messages = $self->{messages} ;
my $filename = shift ;
my $srcdir = shift ;
my $destdir = shift ;
unlink "$destdir/$filename" ;
copy "$srcdir/$filename", "$destdir/$filename"
or die "Failed to get a copy of '$filename' ($!).\n" ;
}
# find path to the template file in generic directories
sub find_generic_template_file {
my $self = shift ;
my $opts = shift ;
my $filename = shift ;
my $check = shift ;
foreach my $dir (@{$opts->{template_dirs}}) {
return $dir
if -e "$dir/$filename" ;
}
return $self->{user_share_dir}
if -e "$self->{user_share_dir}/$filename" ;
die "File '$self->{llgal_share_dir}/$filename' does not exist.\nPlease install llgal properly.\n"
unless -e "$self->{llgal_share_dir}/$filename" or !$check ;
return $self->{llgal_share_dir} ;
}
# find path to the template, using the local one if it exists
sub find_template_file {
my $self = shift ;
my $opts = shift ;
my $filename = shift ;
my $check = shift ;
return "$self->{destination_dir}$self->{local_llgal_dir}"
if -e "$self->{destination_dir}$self->{local_llgal_dir}/$filename" ;
return find_generic_template_file $self, $opts, $filename, $check ;
}
# get a template file from generic directories and save it to local directory
sub get_template_file {
my $self = shift ;
my $opts = shift ;
my $filename = shift ;
my $messages = $self->{messages} ;
if (-e "$self->{destination_dir}$self->{local_llgal_dir}/$filename") {
$messages->print ("Found $filename in $self->{destination_dir}$self->{local_llgal_dir}/, using it.\n") ;
} else {
my $srcdir = find_generic_template_file $self, $opts, $filename, 1 ;
$messages->print ("No $filename in $self->{destination_dir}$self->{local_llgal_dir}/, getting a copy from $srcdir\n") ;
copy_file $self, $filename, $srcdir, "$self->{destination_dir}$self->{local_llgal_dir}" ;
}
}
# Give templates to the given directory
sub give_templates {
my $self = shift ;
my $opts = shift ;
my $destdir = shift ;
my $messages = $self->{messages} ;
if ( ! -e $destdir ) {
$messages->print ("Creating template directory $destdir...\n") ;
mkdir $destdir
or die "Failed to create $destdir ($!)" ;
}
foreach my $filename
( $opts->{css_filename}, $opts->{filmtile_filename}, $opts->{index_link_image_filename},
$opts->{prev_slide_link_image_filename}, $opts->{next_slide_link_image_filename},
$opts->{indextemplate_filename}, $opts->{slidetemplate_filename} ) {
if ( -e "$destdir/$filename" ) {
$messages->print ("$filename already exists in $destdir.\n") ;
} else {
my $srcdir = find_generic_template_file $self, $opts, $filename, 1 ;
$messages->print ("$filename does not exist in $destdir, getting a copy from $srcdir...\n") ;
copy_file $self, $filename, $srcdir, $destdir ;
}
}
}
# Get llgal files
sub get_llgal_files {
my $self = shift ;
my $opts = shift ;
my $messages = $self->{messages} ;
# Get the film tile for the index
if ($opts->{show_film_effect}) {
if ($opts->{filmtile_location}) {
$messages->print ("Using the film tile that is available on $opts->{filmtile_location}.\n") ;
} else {
get_template_file $self, $opts, $opts->{filmtile_filename} ;
}
}
# Get link images
if ($opts->{index_link_image}) {
if ($opts->{index_link_image_location}) {
$messages->print ("Using the index link image that is available on $opts->{index_link_image_location}.\n") ;
} else {
get_template_file $self, $opts, $opts->{index_link_image_filename} ;
}
}
if ($opts->{prev_slide_link_image} and ! $opts->{prev_slide_link_preview}) {
if ($opts->{prev_slide_link_image_location}) {
$messages->print ("Using the prev slide link image that is available on $opts->{prev_slide_link_image_location}.\n") ;
} else {
get_template_file $self, $opts, $opts->{prev_slide_link_image_filename} ;
}
}
if ($opts->{next_slide_link_image} and ! $opts->{next_slide_link_preview}) {
if ($opts->{next_slide_link_image_location}) {
$messages->print ("Using the next slide link image that is available on $opts->{next_slide_link_image_location}.\n") ;
} else {
get_template_file $self, $opts, $opts->{next_slide_link_image_filename} ;
}
}
# Get the css
if ($opts->{css_location}) {
$messages->print ("Using the CSS that is available on $opts->{css_location}.\n") ;
} else {
get_template_file $self, $opts, $opts->{css_filename} ;
}
}
1 ;
llgal-0.13.17/lib/Llgal/Messages.pm 0000644 0001750 0000144 00000004135 10610771225 016230 0 ustar bgoglin users package Llgal::Messages ;
use strict ;
# messaging context
sub new {
my $self = {} ;
bless $self ;
$self->{indent} = "" ;
$self->{percentage_total} = 0 ;
$self->{delayed_warning} = 0 ;
$self->{pending_warnings} = "" ;
$self->{verbose} = 0 ;
return $self ;
}
sub copy {
my $self = shift ;
my $new_self = {
indent => $self->{indent},
percentage_total => $self->{percentage_total},
percentage_in_progress => $self->{percentage_in_progress},
delayed_warning => $self->{delayed_warning},
pending_warnings => $self->{pending_warnings},
verbose => $self->{verbose},
} ;
bless $new_self ;
return $new_self ;
}
# indented printing
sub print {
my $self = shift ;
print $self->{indent} ;
print @_ ;
}
sub indent {
my $self = shift ;
$self->{indent} .= " " ;
}
# notice (verbose mode only)
sub notice {
my $self = shift ;
print @_
if $self->{verbose} ;
}
# Warnings are shown after each step of processing to avoid
# breaking precentage progressions and so
my $warning_prefix = "!! " ;
sub warning {
my $self = shift ;
while (@_) {
my $line = shift ;
chomp $line ;
if ($self->{delayed_warning}) {
$self->{pending_warnings} .= $warning_prefix.$line."\n" ;
} else {
print $warning_prefix.$line."\n" ;
}
}
}
sub delay_warnings {
my $self = shift ;
$self->{delayed_warning} = 1 ;
}
sub show_delayed_warnings {
my $self = shift ;
print $self->{pending_warnings} ;
$self->{pending_warnings} = "" ;
$self->{delayed_warning} = 0 ;
}
# percentage printing
sub init_percentage {
my $self = shift ;
$self->{delayed_warning} = 1 ;
$self->{percentage_total} = shift ;
print " 0.00%" ;
}
sub update_percentage {
my $self = shift ;
my $i = shift ;
my $val = $i*100/$self->{percentage_total} ;
printf "\b\b\b\b\b\b\b\b% 7.2f%%", $val ;
}
sub end_percentage {
my $self = shift ;
printf "\b\b\b\b\b\b\b\b% 7.2f%%\n", 100 ;
$self->show_delayed_warnings () ;
}
sub abort_percentage {
my $self = shift ;
print "\n" ;
$self->show_delayed_warnings () ;
}
1 ;
llgal-0.13.17/lib/Llgal/Utils.pm 0000644 0001750 0000144 00000001511 10515753317 015562 0 ustar bgoglin users package Llgal::Utils ;
use strict ;
# system routine which:
# - takes a description followed by cmdline arguments
# - returns a table composed of the status followed by STDERR and STDOUT lines
sub system_with_output {
my $descr = shift ;
pipe (my $pipe_out, my $pipe_in) ;
my $pid = fork() ;
if ($pid < 0) {
close $pipe_in ;
close $pipe_out ;
return ( -1, "Fork failed while trying to $descr\n" ) ;
} elsif ($pid > 0) {
close $pipe_in ;
waitpid ($pid, 0) ;
my $status = $? >> 8 ;
$status = -1
if $status == 255 ;
my @lines = <$pipe_out> ;
close $pipe_out ;
return ( $status , @lines ) ;
} else {
close $pipe_out ;
open STDERR, ">&", $pipe_in ;
open STDOUT, ">&", $pipe_in ;
{ exec @_ } ;
print $pipe_in "Exec of $_[0] failed while trying to $descr\n" ;
close $pipe_in ;
exit -1 ;
}
}
1;
llgal-0.13.17/lib/MANIFEST 0000644 0001750 0000144 00000000131 10425226234 014210 0 ustar bgoglin users MANIFEST
Makefile.PL
Llgal/Config.pm
Llgal/Messages.pm
Llgal/Templates.pm
Llgal/Utils.pm
llgal-0.13.17/lib/Makefile.PL.in 0000644 0001750 0000144 00000000130 10420454163 015434 0 ustar bgoglin users use ExtUtils::MakeMaker;
WriteMakefile (
NAME => 'Llgal',
VERSION => "@VERSION@",
);
llgal-0.13.17/llgalrc.5 0000644 0001750 0000144 00000041661 11615752214 014040 0 ustar bgoglin users .\" Process this file with
.\" groff -man -Tascii foo.1
.\"
.TH llgalrc 5 "NOVEMBER 2006"
.SH NAME
llgalrc \- Configuration file for llgal
.SH Names of generic llgal files:
.I captions_header_filename = \fI"filename"
.RS
Name of the captions header file that is inserted at the beginning of
generated captions files.
Default is
.BR captions.header .
.RE
.I css_filename = \fI"filename"
.RS
Name of the CSS file.
Default is \fBllgal.css\fR.
.RE
.I filmtile_filename = \fI"filename"
.RS
Name of the film tile image.
Default is \fBtile.png\fR.
Note that it must match the one that is used in the CSS file.
.RE
.I index_link_image_filename = \fI"filename"
.RS
Change image name for link to the index.
Default is \fBindex.png\fR.
.RE
.I next_slide_link_image_filename = \fI"filename"
.RS
Change image name for link to the next slide.
Default is \fBnext.png\fR.
.RE
.I previous_slide_link_image_filename = \fI"filename"
.RS
Change image name for link to the previous slide.
Default is \fBprev.png\fR.
.RE
.I indextemplate_filename = \fI"filename"
.RS
Name of the HTML index template.
Default is \fBindextemplate.html\fR.
.RE
.I slidetemplate_filename = \fI"filename"
.RS
Name of the HTML slide template.
Default is \fBslidetemplate.html\fR.
.RE
.SH Location of llgal files if available on the web
.I css_location = \fI"url"
.RS
The location of the CSS on the web instead of a local one
.RB [ "--uc " ].
If ending with a slash,
.I css_filename
will be appended.
.RE
.I filmtile_location = \fI"url"
.RS
The location of the filmtile image on the web instead of a local one
.RB [ "--ui " ].
If ending with a slash,
.I filmtile_filename
will be appended.
.RE
.I index_link_image_location = \fI"url"
.RS
The location of the index link image on the web instead of a local one
.RB [ "--ui " ].
If ending with a slash,
.I index_link_image_filename
will be appended.
.RE
.I prev_slide_link_image_location = \fI"url"
.RS
The location of the prev slide link image on the web instead of a local one
.RB [ "--ui " ].
If ending with a slash,
.I prev_slide_link_image_filename
will be appended.
.RE
.I next_slide_link_image_location = \fI"url"
.RS
The location of the next slide link image on the web instead of a local one
.RB [ "--ui " ].
If ending with a slash,
.I next_slide_link_image_filename
will be appended.
.RE
.SH Location and name of generated files:
.I local_llgal_dir = \fI"subdirectory name"
.RS
The name of the subdirectory where llgal generated files will be
stored.
This option is only available in system- and user-wide configuration
files.
Default is
.BR .llgal/ .
.RE
.I index_filename = \fI"filename"
.RS
Name of the generated index file
.RB [ "-i " ].
Default is
.BR index .
.RE
.I slide_filenameprefix = \fI"filename prefix"
.RS
Prefix of generated HTML slide filenames.
Default is \fB"slide_"\fR.
Note that this prefix is used to decide what HTML to delete when
.B --clean
is passed.
Setting this option to an empty string will make llgal remove
.I all
HTML files.
.RE
.I scaled_image_filenameprefix = \fI"filename prefix"
.RS
Prefix used to determine slide-image filenames from original images
(in case of
.BR --sx " or " --sy ).
Default is \fB"scaled_"\fR.
.RE
.I thumbnail_image_filenameprefix = \fI"filename prefix"
.RS
Prefix used to determine thumbnail filenames from original images.
Default is \fB"thumb_"\fR.
.RE
.I captions_filename = \fI"filename"
.RS
Name of the caption file that will be generated when llgal is called
with
.BR --gc ,
or will be automatically used if it exists to generate slide captions.
Default is \fB"captions"\fR.
.RE
.I user_scaled_image_filenameprefix = \fI"filename prefix"
.RS
Additional prefix of user-provided scaled images.
Default is \fBmy\fR.
.RE
.I user_thumbnail_image_filenameprefix = \fI"filename prefix"
.RS
Additional prefix of user-provided thumbnails.
Default is \fBmy\fR.
.RE
.I path_separator_replacement = \fI"char"
.RS
Character to use to replace / in the thumbnail/scaled of subdir
images.
Default is \fB@\fR.
.RE
.SH Index:
.I index_cellpadding =
.RS
Cellpadding in the index table
.RB [ "-p " ].
Default is
.BR 3 .
.RE
.I list_links = <0/1>
.RS
Display links and text as regular text instead of thumbnails in the main
gallery thumbnail index
.RB [ -L ].
Default is
.BR 0 " (" disabled ).
.RE
.I pixels_per_row =
.RS
Pixels per row of thumbnails in index
.RB [ "-wx " ].
Default is
.BR 0 " (" unlimited ).
.RE
.I thumbnails_per_row =
.RS
Thumbnails per row in index
.RB [ "-w " ].
Default is
.BR 5 .
.RE
.I thumbnail_height_max =
.RS
Maximal height of thumbnails
.RB [ "--ty " ].
Default is
.BR 75 .
Changing this value does not affect the maximal width (see
.IR thumbnail_width_max ).
.RE
.I thumbnail_width_max =
.RS
Maximal width of thumbnails
.RB [ "--tx "].
If
.B 0
is used, the width is unlimited.
If not
.BR 0 ,
all thumbnails are padded to the given width.
Default is
.BR 113 .
Changing this value does not affect the maximal height (see
.IR thumbnail_height_max ).
.RE
.I show_caption_under_thumbnails = <0/1>
.RS
Write captions under thumbnails
.RB [ -u ].
Default is
.BR 0 " (" disabled ).
.RE
.I show_film_effect = <0/1>
.RS
Show film effect
.RB [ --fe ].
Default is
.BR 0 " (" disabled ).
.RE
.I MVI_link_to_target = <0/1>
.RS
Make movie thumbnails links point to the movie instead of
the corresponding slide.
Default is
.BR 1 " (" "link to the movie" ")."
.RE
.I FIL_link_to_target = <0/1>
.RS
Make file thumbnails links point to the file instead of
the corresponding slide.
Default is
.BR 1 " (" "link to the file" ")."
.RE
.I DIR_link_to_target = <0/1>
.RS
Make directory thumbnails links point to the movie instead of
the corresponding slide.
Default is
.BR 1 " (" "link to the directory" ")."
.RE
.I LNK_link_to_target = <0/1>
.RS
Make link thumbnails point to the link instead of
the corresponding slide.
It is similar to using
.I LNKNOSLIDE:
entries instead of
.IR LNK: .
Default is
.BR 1 " (" "link to the link target" ")."
.RE
.SH Slides:
.I make_no_slides = <0/1>
.RS
Make no slides
.RB [ -s ].
Default is
.BR 0 " (" "make slides" ).
.RE
.I make_slide_filename_from_filename = <0/1>
.RS
Use filenames as slide filenames
.RB [ -n ].
Default is
.BR 0 " (" disabled ).
.RE
.I make_slide_filename_from_extension = <0/1>
.RS
Also use extension in slide filename when generated from filename.
Default is
.BR 0 " (" disabled ).
.RE
.I slide_dimensions_from_css = <0/1>
.RS
Do not output any absolute image size in the HTML code and assume the
CSS style sheet will take care of it (in table.slide td.image-slide img).
Default is
.BR 0 " (" disabled ).
.RE
.I slide_width_max =
.RS
Maximal width of slides
.RB [ "--sx " ].
Default is
.BR 0 " (" unlimited ).
.RE
.I slide_height_max =
.RS
Maximal height of slides
.RB [ "--sy " ].
Default is
.BR 0 " (" unlimited ).
.RE
.I text_slide_width =
.RS
Default width of text slides.
Default is
.BR 400 .
.RE
.I text_slide_height =
.RS
Default height of text slides.
Default is
.BR 300 .
.RE
.I index_link_image = <0/1>
.RS
Use an image instead of a text label for the link to the index
.RB [ --li ].
Default is
.BR 0 " (" disabled ).
.RE
.I prev_slide_link_image = <0/1>
.RS
Use an image instead of a text label for the link to the previous
slide
.RB [ --li ].
Default is
.BR 0 " (" disabled ).
.RE
.I next_slide_link_image = <0/1>
.RS
Use an image instead of a text label for the link to the next slide
.RB [ --li ].
Default is
.BR 0 " (" disabled ).
.RE
.I prev_slide_link_preview = <0/1>
.RS
Use a thumbnail preview instead of a text label for the link to the
previous slide
.RB [ --lt ].
Default is
.BR 0 " (" disabled ).
.RE
.I next_slide_link_preview = <0/1>
.RS
Use a thumbnail preview instead of a text label for the link to the
next slide
.RB [ --lt ].
Default is
.BR 0 " (" disabled ).
.RE
.I link_between_last_and_first = <0/1>
.RS
Generate links between last and first slides or galleries.
Default is
.BR 1 " (" enabled ).
.RE
.I make_slide_title_from_caption = <0/1>
.RS
Generate slide titles from captions
.RB [ -k ].
Default is
.BR 0 " (" disabled ).
.RE
.I show_exif_tags =
.RS
Display a table of EXIF tags under each image slide
.RB [ --exif ].
The tags are given with their name in
.B exiftool -list
and separated with a comma.
.RE
.I show_all_exif_tags = <0/1>
.RS
Display a table of all available EXIF tags under each image slide
.RB [ --exif ].
.RE
.I slide_link_to_full_image = <0/1>
.RS
Link scaled image in slides to full unscaled images
.RB [ --nf ].
Default is
.BR 1 " (" enabled ).
.RE
.SH Captions:
.I captions_removal_line = \fI"string"
.RS
This line will be added to the caption file llgal will generate when
called with
.BR --gc .
If the user doesn't want llgal to remove this caption file when called
with
.BR --clean ,
he just needs to remove this line from the file.
Default is \fB"REMOVE THIS LINE IF LLGAL SHOULD NOT REMOVE THIS FILE"\fR.
.RE
.I make_caption_from_filename = <0/1>
.RS
Generate captions from filenames without their extension
.RB [ --cf ].
Default is
.BR 0 " (" disabled ).
.RE
.I make_caption_from_extension = <0/1>
.RS
Generate captions from filenames with their extension.
.BR 0 " (" disabled ).
.RE
.I make_caption_from_image_comment = ",-separated strings of +-separated strings"
.RS
Generate captions from image comment tag
.RB [ --cc ].
Default is \fB""\fR
.RB ( disabled ).
.RE
.I make_caption_from_image_comment = <0/1>
.RS
Add image timestamp to generated captions
.RB [ --ct ].
Default is
.BR 0 " (" disabled ).
.RE
.I show_dimensions = <0/1>
.RS
Show image dimensions
.RB [ -a ", " -ad ].
Default is
.BR 0 " (" disabled ).
.RE
.I show_size = <0/1>
.RS
Show file sizes
.RB [ -a ", " -as ].
Default is
.BR 0 " (" disabled ).
.RE
.I slide_counter_format = \fI"format"
.RS
Change the format of the counter on the slides.
\fB%n\fR is replaced with the slide number, \fB%0n\fR gets leading zeros,
and \fB%t\fR is replaced with the number of slides.
Default is \fB" (%0n/%t)"\fR.
Slide counter may be disabled by setting to an empty string
.RB [ --nc ].
.RE
.SH Text:
.I index_title_default = \fI"string"
.RS
Default title of the gallery.
May be overridden with [\-\-title ] or TITLE: in the captions file.
Default is \fB"Index of pictures"\fR.
.RE
.I parent_gallery_link_text = \fI"string"
.RS
Label of the link to the parent directory.
Default is \fB"Back to parent gallery"\fR.
.RE
.I prev_gallery_link_text = \fI"string"
.RS
Label of the link to the previous gallery.
Default is \fB"Previous gallery "\fR.
.RE
.I next_gallery_link_text = \fI"string"
.RS
Label of the link to the next gallery.
Default is \fB"Next gallery "\fR.
.RE
.I index_link_text = \fI"string"
.RS
Label of the link from a slide to the index.
Default is \fB"Index"\fR.
.RE
.I prev_slide_link_text = \fI"string"
.RS
Label of the link from a slide to the prev one.
Default is \fB"Prev>>"\fR.
.RE
.I next_slide_link_text = \fI"string"
.RS
Label of the link from a slide to the next one.
Default is \fB"Next>>"\fR.
.RE
.I MVI_link_text = \fI"string"
.RS
Text prefixing the filename when generating link text for movies without
a captions file.
Default is \fB"Open movie "\fR.
.RE
.I FIL_link_text = \fI"string"
.RS
Text prefixing the filename when generating link text for files without
a captions file.
Default is \fB"Download file "\fR.
.RE
.I DIR_link_text = \fI"string"
.RS
Text prefixing the filename when generating link text for directories
without a captions file.
Default is \fB"Open subgallery "\fR.
.RE
.I alt_full_text = \fI"string"
.RS
Text shown as an image alternative for full-size images in slides.
Default is \fB""\fR.
.RE
.I alt_scaled_text = \fI"string"
.RS
Text shown as an image alternative for scaled images in slides.
Default is \fB"Scaled image "\fR.
.RE
.I alt_thumbnail_text = \fI"string"
.RS
Text shown as an image alternative for thumbnails in the index.
Default is \fB"Thumbnail "\fR.
.RE
.I alt_film_tile_text = \fI"string"
.RS
Text shown as an image alternative for the film tile in the index.
Default is \fB"Film Tile"\fR.
.RE
.I over_scaled_text = \fI"string"
.RS
Text shown when the mouse pointer is over a scaled image in a slide.
Default is \fB"Click to see full size "\fR.
.RE
.I over_thumbnail_text = \fI"string"
.RS
Text shown when the mouse pointer is over a thumbnail.
Default is \fB"Click to enlarge "\fR.
.RE
.I over_index_link_text = \fI"string"
.RS
Text shown when the mouse pointer is over a link from a slide to the index.
Default is \fB"Return to the index"\fR.
.RE
.I over_prev_slide_link_text = \fI"string"
.RS
Text shown when the mouse pointer is over a link from a slide to the previous one.
Default is \fB"Previous slide "\fR.
.RE
.I over_next_slide_link_text = \fI"string"
.RS
Text shown when the mouse pointer is over a link from a slide to the next one.
Default is \fB"Next slide "\fR.
.RE
.I show_size_unit = \fI"string"
.RS
Unit to be used when printing sizes
.RB [ "--asu " ]
Default is \fB"kB"\fR.
.RE
.I timestamp_format_in_caption = "timestamp format"
.RS
Change the strftime format used when generating captions from image date
.RB [ "--ct " ].
Default is \fB"%Y-%m-%d %H:%M:%S"\fR.
.RE
.I credits_text = \fI"string"
.RS
Credits text at the bottom of the index
Default is \fB"created with llgal"\fR.
.RE
.SH What files to insert in the gallery:
.I image_extensions = \fI"|-separated strings"
.RS
Extensions that are matched when searching images
Default is \fB"jpg|jpeg|png|gif|tif|tiff|bmp"\fR.
.RE
.I movie_extensions = \fI"|-separated strings"
.RS
Extensions that are matched when searching movies
Default is \fB"mpg|mpeg|avi|mov|ogm|wmv"\fR.
.RE
.I add_all_files = <0/1>
.RS
Add all files to the list of entries, not only images and movies
.RB [ -A ].
Default is
.BR 0 " (" disabled ).
.RE
.I add_subdirs = <0/1>
.RS
Add subdirectories to the list of entries
.RB [ -S ].
Default is
.BR 0 " (" disabled ).
.RE
.I exclude = \fI"string"
.RS
Exclude files whose name matches
.RB [ "--exclude " ].
This option may be used several times.
Dot beginning files and html files are excluded by default.
.RE
.I include = \fI"string"
.RS
Include files whose name matches and were previously excluded
.RB [ "--include " ].
This option may be used several times.
The order of includes and excludes is respected.
.RE
.I sort_criteria = \fI"string"
.RS
Sort criteria when scanning files in the working directory.
Default is \fB"name"\fR.
.RE
.SH Sections:
.I section_dir = \fI"subdir"
.RS
Include subdirectory contents in the gallery
.RB [ "-P " ].
This option may be used several times.
Subdirectory path must be given relatively to the working directory.
Default is to use the content of the working directory.
.RE
.I recursive_sections = <0/1>
.RS
Add all subdirectories to the list of sections
.RB [--Pall].
Default is
.BR 0 " (" disabled ).
.RE
.I entitle_sections = <0/1>
.RS
Add the subdirectory name as a title at the beginning each section
.RB [ --Ps ].
Default is
.BR 0 " (" disabled ).
.RE
.I separate_sections = <0/1>
.RS
Add a horizontal line at the beginning of each section in the index
.RB [ --Ps ].
Default is
.BR 0 " (" disabled ).
.RE
.SH Recursion:
.I recursive = <0/1>
.RS
Run recursively in subdirectories
.RB [ -R ].
Default is
.BR 0 " (" disabled ).
.RE
.I link_subgalleries = <0/1>
.RS
Add links between subgalleries
.RB [ --Rl ].
Default is
.BR 0 " (" disabled ).
.RE
.I parent_gallery_link = <0/1>
.RS
Add links to the parent directory
.RB [ --parent ].
Default is
.BR 0 " (" disabled ).
.RE
.SH Various:
.I additional_configuration_file = \fI"filename"
.RS
Additional configuration file that is parsed immediately
(before processing the following lines)
.RB [ "--config " ].
This option may be used several times.
.RE
.I additional_template_dir = \fI"path"
.RS
Additional template directories
.RB [ --templates ].
This option may be used multiple times.
.RE
.I codeset = \fI"codeset"
.RS
Codeset to be set in HTML headers
.RB [ "--codeset " ].
.RE
.I language = \fI"locale"
.RS
Language to be used for generated text in HTML pages
.RB [ "--lang " ].
If set, the
.B LANGUAGE
environment variable might prevent this option from working.
.RE
.I scaled_create_command = \fI"string"
.RS
Command to use to create scaled images for slides.
Default is \fB"convert \-\-scale x \-\- "\fR.
See
.B THUMBNAILS AND SCALED IMAGES GENERATION
for details.
.RE
.I thumbnail_create_command = \fI"string"
.RS
Command to use to create thumbnails for the index.
Default is \fB"convert \-\-scale x \-\- "\fR.
See
.B THUMBNAILS AND SCALED IMAGES GENERATION
for details.
.RE
.I force_image_regeneration = <0/1>
.RS
Force regeneration of thumbnails and scaled images
.RB [ -f ].
Default is
.BR 0 " (" disabled ).
.RE
.I verbose = <0/1>
.RS
Print notice messages
.RB [ -v ].
Default is
.BR 0 " (" disabled ).
.RE
.I www_access_rights = <0/1>
.RS
Make all generated files world readable
.RB [ --www ].
Default is
.BR 0 " (" disabled ).
.RE
.I www_extension = \fI"string"
.RS
Extension of generated webpages
.RB [ --php ].
Default is \fB"html"\fR.
.RE
.SH SEE ALSO
.PP
.BR llgal (1)
The
.I llgalrc
template file provided within the documentation directory.
.SH AUTHOR
Brice Goglin
llgal-0.13.17/llgal.1 0000644 0001750 0000144 00000072155 11615752214 013511 0 ustar bgoglin users .\" Process this file with
.\" groff -man -Tascii foo.1
.\"
.TH LLGAL 1 "NOVEMBER 2006"
.SH NAME
llgal \- On-line gallery generator
.SH SYNOPSIS
.B llgal
.I [-option1 -option2 ...]
.SH DESCRIPTION
.B llgal
is a quick and easy program for placing your images and movies online with
just one command-line. It generates a pretty good-looking set of static HTML
slides even with its default settings. To try it out just run
.B llgal
in a directory with
.BR "jpg" ", " "png" ", " "mpg" ", etc"
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
.I llgal.css
files in the
.I .llgal/
subdirectory that appeared in your image directory, or
by defining
.IR "indextemplate.html" " or " "slidetemplate.html" " files."
llgal also checks for the existence of a
.I $HOME/.llgal/
directory where users can store their own templates, overriding the
site-wide
.IR "/usr/share/llgal" "."
(See
.B FILES
for details).
The HTML webpages are generated from the templates by replacing
several fields
(See
.BR TEMPLATES ).
The layout might be configured through the list of options
that are given in
.BR "LAYOUT" "."
llgal uses all images and videos it finds in the current directory.
See
.B SELECTING FILES
to include directories or other files and excludes some filenames.
The index includes thumbnails that llgal generates from original
images.
It is possible to provide custom thumbnails by placing them in the
.I .llgal/
directory with the
.I mythumb_
prefix.
Custom thumbnails for movies have to be suffixed with an image-type
extension.
For instance, to enforce the thumbnail for image
.IR image.jpg " and movie " movie.avi ,
thumbnails may be named
.IR mythumb_image.jpg " and " mythumb_movie.avi.jpg .
The slide pages may include a scaled image in the
.B --sx
or
.B --sy
option is passed.
Similarly, it is also possible to define custom scaled images with the
.I myscaled_
prefix to appear in the slides.
Note that all command line options (except those from
.BR "BEHAVIOR OPTIONS" ),
and even more, might be stored in a configuration file
to help generation of multiple galleries with the same
layout.
See
.B CONFIGURATION
for details.
.SH BEHAVIOR OPTIONS
By default, llgal generates a gallery.
If one of the following option is passed,
it will process it and exit immediately.
.TP
.B --clean
Remove all files that llgal may have created earlier and that user did
not modify since.
.TP
.B --cleanall
Remove all files that llgal may have created earlier. This includes
thumbnails, scaled down slides, all HTML files, captions file, film
effect picture, indextemplate and slidetemplate and the style-sheet
file.
.TP
.B --gc
Generate slide captions in
.I .llgal/captions
file that you may edit. The format of this file is very simple.
.RB "See " CAPTIONS " for details."
These captions may then be modified by the user.
The file will be automatically used next time
.B llgal
is invoked.
.B --gc
might also be used to update the
.I captions
file when new files were added to the working directory.
.TP
.BI --gt " []"
Copy template files to the directory.
The special value
.I local
might be used for the local
.I .llgal/
directory, while
.I user
might be used for the user
template directory
.IR $HOME/.llgal/ .
Any other directory is acceptable.
llgal will create the target directory if it does not exist.
The argument is optional.
Its default value is
.BR local .
See
.B FILES
for details about template files.
.TP
.B -h, --help
Display brief help.
.TP
.B -V, --version
Display llgal version.
.SH ADDITIONAL BEHAVIOR OPTIONS
llgal behavior may be modified with the following options,
either when generating a gallery or not.
.TP
.BI --config " "
Read the file
.I file
as a configuration.
See
.B CONFIGURATION
for details.
Note that
.B --config
may be used several times on the same command line.
The corresponding configuration file option is
.IR additional_configuration_file .
.TP
.BI -d " "
Operate in directory
.I
when generating the HTML files, thumbnails and scaled images.
The default is the current directory.
.TP
.B -f
Force thumbnail regeneration. Also forces medium-slide regeneration if
.BR --sx " or " --sy
is given. Otherwise llgal will not regenerate these files if they
already exist, and you may end up with stale copies. Definitely use
.B -f
between two runs where you've changed the value of
.BR --tx ", " --ty ", " --sx " or " --sy "."
The corresponding configuration file option is
.IR force_image_regeneration .
.TP
.BI --gencfg " "
Output configuration in
.I file
for future reutilization through
.BR --config "."
If
.B local
is passed as
.IR file ", then the local"
.B .llgal/llgalrc
file is created in each gallery that is processed (in case of recursion).
See
.B CONFIGURATION
for details.
.TP
.BI --option " 'variable = value'"
Configure using a configuration file option.
See
.B CONFIGURATION
for details.
Note that
.B --option
may be used several times on the same command line.
.TP
.B -R
Enable recursive mode.
llgal will be run inside subdirectories.
This option might be used either to generate galleries
in all subdirectories, or their captions files, or to
clean recursively, etc.
The corresponding configuration file option is
.IR recursive .
When generating a gallery, this option implies
.B -S
that means llgal will use all existing subdirectories in no captions
file is defined.
If a captions file is defined, only the
.B DIR:
entries will be entered recursively.
See
.B CAPTIONS
for details abour
Note that recursive behavior does only use the contents
of the captions file to choose which subgalleries to
enter when generating the gallery or the captions file.
All other behaviors, including recursive cleaning (
.B -R
used together with
.B --clean
or
.BR --cleanall ),
will
.B not
check whether a subdirectory is in the captions file.
All not-dot-beginning subdirectories will be cleaned.
.TP
.B -v, --verbose
Display notice messages.
The corresponding configuration file option is
.IR verbose .
.SH SELECTING FILES
.TP
.B -A
All files in the current directory will get a slides,
except .html or dot-beginning files.
Files are matched as images or movies first, and then
reverted as simple files instead.
The corresponding configuration file option is
.IR add_all_files .
See
.B -S
for details about adding slides for subdirectories.
.TP
.BI --exclude " "
Exclude files whose name matches
.IR .
The corresponding configuration file option is
.IR exclude .
.TP
.BI --include " "
Include files whose name matches
.I
and where previously excluded.
The corresponding configuration file option is
.IR include .
.TP
.BI -P " "
Use photos in the subdirectory instead of the working directory.
May be used multiple times to group multiple subdirectories in the
same gallery.
The path of the subdirectory must be given as a relative path
(relative to
.BR . " or to the path given to " -d ")."
The corresponding configuration file option is
.IR section_dir .
.TP
.B --Pall
Use photos in all subdirectories all the working directory as if
.B -P
was used for all of them.
The corresponding configuration file option is
.IR recursive_sections .
.TP
.BI --Ps
Add a horizontal line and the subdirectory name as a title at
the beginning of each section.
The corresponding configuration file options are
.IR entitle_sections " and " separate_sections .
.TP
.B -S
Each subdirectory will get a dedicated slide.
If a captions file exists, only the subdirectories that
it defines will be processed.
If no captions file exists, llgal will process all subdirectories but
those whose name begins with a dot.
The corresponding configuration file option is
.IR add_subdirs .
Contrary to
.B -R
this option will not make llgal run recursively in subdirectories.
.B -S
does only define the list of subdirectories that appear
in the current gallery.
.SH LAYOUT OPTIONS
.TP
.B -a
Write image dimensions and sizes under each thumbnail on the index page,
and under each slide if
.BR --sx " or " --sy
was passed.
The corresponding configuration file options are
.IR show_dimensions " and " show_size .
This only works if the ImageMagick command
.B identify
is present.
.TP
.B --ad
Like
.B -a
but write only the image dimensions.
The corresponding configuration file option is
.IR show_dimensions .
.TP
.B --as
Like
.B -a
but write only the image sizes.
The corresponding configuration file option is
.IR show_size .
.TP
.BI --asu " "
Allow to define the unit used to show file sizes.
Default is \fB"kB"\fR.
The corresponding configuration file option is
.IR show_size_unit .
.TP
.BI --cc " []"
Generates
.I captions
from image comment tag.
If no argument is given, llgal first tries the standard comment (for
instance JFIF or GIF), then tries Exif comments if the previous
one is empty, and then tries Exif image description.
The corresponding configuration file option is
.IR make_caption_from_image_comment .
An argument such as
.I std
or
.I exif
or
.I exifdesc
might be added to force the use of only standard comment,
only Exif comment, or only Exif image description.
An argument such as
.I exif,std
will make llgal try Exif comment first.
An argument such as
.I std+exifdesc
will use the combination of standard comment and Exif description.
Passing
.B --cc
without argument is thus equivalent to passing
.B --cc
.IR std,exif,exifdesc .
.TP
.B --cf
Generates
.I captions
from file names (strips suffix).
The corresponding configuration file option is
.IR make_caption_from_filename .
.TP
.B --ct " [strftime_format]"
Add image timestamp tag to the generated captions,
and change its format if the optional argument is given
(replaces the old \-\-ctf option).
The corresponding configuration file option are
.IR make_caption_from_image_timestamp " and " timestamp_format_in_caption .
.TP
.BI --codeset " codeset"
Change the encoding in the header of the generated HTML pages.
By default, the encoding is got from the locale configuration.
The corresponding configuration file option is
.IR codeset .
.TP
.BI --exif " []"
Display a table of EXIF tags under each image slide.
The corresponding configuration file options are
.IR show_exif_tags " and " show_all_exif_tags .
If an argument is given, it contains a comma-separated list
of tags.
The tag names have to be passed as shown by
.BR "exiftool -list" .
If no argument is given, all available Exif tags are displayed.
The tags are displayed using their description as given by
.BR "exiftool -s myimage" .
.TP
.B --fe
Show a film effect in the index of thumbnails. The aspect of this
effect may be configured by replacing the tile file that llgal
puts in
.IR .llgal .
The corresponding configuration file option is
.IR show_film_effect .
.TP
.BI -i " "
Name of the main thumbnail index file. The default is
.BR index ,
as desirable for most web servers.
The corresponding configuration file option is
.IR index_filename .
The default extension is
.B html
and might be changed with
.B --php
or the
.I www_extension
configuration option.
.TP
.B -k
Use the image captions for the HTML slide titles.
The default behavior is to use the image names.
The corresponding configuration file option is
.IR make_slide_title_from_caption .
.TP
.B -L
Do not create thumbnails for text and links (including video, file and url),
but list them as a text line between thumbnail rows in the main gallery index.
Might be used when the directory only contains subgalleries and thus does
not need any thumbnail.
The corresponding configuration file option is
.IR list_links .
.TP
.BI --lang " locale"
Change the locale used to translate the text that is automatically
generated in the HTML pages.
The corresponding configuration file option is
.IR language .
Note that the
.B LANGUAGE
environment variable might prevent this option from working if set.
.TP
.B --li
Replace link labels in slides (usually
.BR Index ", " Prev " and " Next )
with images (usually
.IR index.png ", " prev.png " and " next.png ).
The corresponding configuration file options are
.IR index_link_image ", " prev_slide_link_image " and " next_slide_link_image .
.TP
.B --lt
Replace link labels in slides (usually
.BR Prev " and " Next )
with a thumbnail to preview previous/next slide.
The corresponding configuration file options are
.IR prev_slide_link_preview " and " next_slide_link_preview .
If passed together with
.BR --li ,
thumbnail preview is used for links to previous/next slide
while the image is for the link to the index is kept.
.TP
.B -n
Use the image file names for the HTML slide files.
Otherwise the default behavior is to simply name your slides
.IR slide_1.html ", " slide_2.html ", "
and so on.
The corresponding configuration file option is
.IR make_slide_filename_from_filename .
.TP
.B --nc
Omit the image count from the captions.
The corresponding configuration file option is
.IR slide_counter_format .
.TP
.B --nf
Omit the link from scaled images in slides to full unscaled images.
The corresponding configuration file option is
.IR slide_link_to_full_image .
.TP
.BI -p " "
The cellpadding value of the thumbnail index tables.
The default is
.BR 3 .
The corresponding configuration file option is
.IR index_cellpadding .
.TP
.B --php
Change the default extension of generated webpages from
.I html
to
.IR php .
The corresponding configuration file option is
.IR www_extension .
Note that template names are not modified and keep their
.I html
extension even if they contain some PHP code.
Note that llgal will only remove existing webpages corresponding to
this extension when generating a new gallery or cleaning.
.TP
.B --parent-gal
Add links to the parent directory.
The corresponding configuration file option is
.IR parent_gallery_link .
This option is used internally for recursive galleries, and
thus not documented in
.BR --help .
These links are stored as a header and a footer for the index.
The text in the links might be changed through the
.B parent_gallery_link_text
configuration option.
.TP
.B --Rl
Add links between subgalleries.
The corresponding configuration file option is
.IR link_subgalleries .
.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.
The corresponding configuration file option is
.IR make_no_slides .
.TP
.BI --sort " [rev]"
Change sort criteria when scanning files in the working directory.
Default is \fB"name"\fR.
Setting to the empty string means
.BR none .
.BR iname " is case insensitive sort by names."
.BR date " means " time .
.BR rev " might be added for reverse sort."
The corresponding configuration file option is
.IR sort_criteria .
.TP
.BI --sx " "
Instead of using the original image in the slides, insert a scaled
image whose width is less than
.BR " pixels."
The corresponding configuration file option is
.IR slide_width_max .
Useful if your digital camera spits out large images, like 1600x1200.
Clicking on the scaled copies in the HTML slides lets users see the
full unscaled images.
The default is
.B 0
(width is unlimited).
You must use
.B -f
to force regeneration of scaled images if you want to change the value of
.BR --sx .
.TP
.BI --sy " "
Instead of using the original image in the slides, insert a scaled
image whose height is less than
.BR " pixels."
The corresponding configuration file option is
.IR slide_height_max .
Useful if your digital camera spits out large images, like 1600x1200.
Clicking on the scaled copies in the HTML slides lets users see the
full unscaled images.
The default is
.B 0
(height is unlimited).
You must use
.B -f
to force regeneration of scaled images if you want to change the value of
.BR --sy .
.TP
.BI --templates " "
Add a directory to the list of template locations.
The corresponding configuration file option is
.IR additional_template_dir .
.TP
.BI --title " "
Substitutes the string
.I
for
.B
in the index.
The default is
.BR "Index of Pictures" .
It overrides the configuration file option
.IR index_title_default .
.TP
.BI --tx " "
Scale thumbnails so that their width is at most
.IR " pixels."
The default is
.BR 113 .
The corresponding configuration file option is
.IR thumbnail_width_max .
If
.B 0
is used, the width is unlimited.
Changing this value does not affect the maximal height (see
.BR --ty ).
You must use
.B -f
to force regeneration of thumbnails if you want to change the value of
.BR --tx .
.TP
.BI --ty " "
Scale thumbnails so that their height is at most
.IR " pixels."
The default is
.BR 75 .
The corresponding configuration file option is
.IR thumbnail_height_max .
Changing this value does not affect the maximal width (see
.BR --tx ).
You must use
.B -f
to force regeneration of thumbnails if you want to change the value of
.BR --ty .
.TP
.B -u
Write image captions under each thumbnail on the index page.
If you have a
.I captions
file, then the captions are read from there.
The corresponding configuration file option is
.IR show_caption_under_thumbnails .
.TP
.BI --uc " "
Assume the CSS file is available on
.I
and thus do not use a local one.
If ending with a slash, the CSS filename will be appended.
The corresponding configuration file option is
.IR css_location .
.TP
.BI --ui " "
Assume that the filmtile image and index/prev/next slide link images
are available on
.I
and thus do not use local ones.
Their filename will be appended to the given location.
Each image location may be also changed independently
(See
.B CONFIGURATION
for the list of configuration options).
The corresponding configuration file options are
.IR filmtile_location ", " index_link_image_location ", "
.IR prev_slide_link_image_location " and " next_slide_link_image_location .
.TP
.BI -w " "
Set the thumbnail rows to be
.I
images wide in the main index file.
Default is
.BR 5 .
The corresponding configuration file option is
.IR thumbnails_per_row .
.TP
.BI --wx " "
Set the thumbnail rows to be
.I
pixels wide at maximum.
The number of thumbnails per row, given in
.B -w
is reduced if necessary.
The corresponding configuration file option is
.IR pixels_per_row .
Default is to honor
.B -w
without regard to the resulting row width.
.TP
.B --www
Make all generated files world-readable.
The corresponding configuration file option is
.IR www_access_rights .
.SH CAPTIONS
When called with
.B --gc
llgal generates (or updates if already existing) the
.I captions
file in the
.I .llgal/
subdirectory.
When
.B --gc
is not passed, if the
.I captions
file exists, llgal will automatically use it to generate slide
captions in the gallery.
If
.I captions
does not exist, llgal generates captions on the fly and use them in
the gallery.
Generating the
.I captions
file with
.B --gc
before actually using it makes it possible to modify them
(especially to add comments)
or change the order of the slides in the gallery
.B IMG: ----
.RS
defines an image (when omitted,
.B IMG:
is the default type).
.RE
.B MVI: ---- ----
.RS
defines a movie.
.RE
.B TXT: ----
.RS
defines a text slide.
.RE
.B LNK: ---- ----
.RS
defines a link slide.
.RE
.B LNKNOSLIDE: ----
.RS
defines a direct link to the target, without any slide.
.RE
.B FIL: ---- ----
.RS
defines a link to another file (typically neither an image nor a movie)
.RE
.B DIR: ---- ----
.RS
defines a subdirectory slide.
.RE
.B BREAK
.RS
forces a line break in the row of thumbnails
.RE
.B LINE
.RS
forces a line break in the row of thumbnails
and inserts a horizontal line.
.RE
.B TITLE:
.RS
defines the title of the gallery.
.RE
.B INDEXHEAD:
.RS
defines a header (multiple ones are possible).
.RE
.B INDEXFOOT:
.RS
defines a footer (multiple ones are possible).
.RE
.B PARENT:
.RS
defines the label of the link to the parent gallery.
.RE
.B PREV: ----
.RS
defines the label of the link to the previous gallery located by
.IR .
.RE
.B NEXT: ----
.RS
defines the label of the link to the next gallery located by
.IR .
.RE
.B REPLACE: ----
.RS
adds a substitution to be applied to generated HTML pages.
.RE
.TP
Note that you can use whatever HTML syntax in the captions.
.RE
Line beginning with a
.RI #
are ignored.
When generating a captions file, the
.I captions.header
file is inserted at the top of the file to detail
the syntax.
.SH CONFIGURATION
Before parsing command line options, llgal reads several configuration
files. It starts with
.I /etc/llgal/llgalrc
then reads
.I $HOME/.llgal/llgalrc
and finally the
.I .llgal/llgalrc
file in the gallery directory.
Additional configuration files may also be defined with the
.B --config
option.
These will be parsed during command-line parsing, when
.B --config
is met.
In case of recursive generation (with
.B -R
) in multiple subdirectories, the system- and user-wide configuration
files and those passed to
.B --config
are taken in account for all galleries.
However, only the local
.I .llgal/llgalrc
file is used for each gallery.
Especially, the one in the root gallery directory is only taken in
account when generating the root gallery, not when generating those
in subdirectories.
To use a same specific configuration file for the root gallery and all
subgalleries, the
.B --config
option may be used.
All these files may change llgal configuration in the same way command
line options do, and even more.
All following options may also be used on the command line through
.B --option
.IR "'variable = value'" .
See also the manpage of
.I llgalrc
or
.I /etc/llgal/llgalrc
for details about these options and their default values.
.SH THUMBNAILS AND SCALED IMAGES GENERATION
By default, llgal uses convert to create thumbnails and scaled images
(the ones that appear in the slides when
.IR --sx " or " --sy
was passed).
The command lines used to generate those images from your original images
are defined by the following configuration options:
.RS
.I scaled_create_command = "convert --scale x -- "
.RE
.RS
.I thumbnail_create_command = "convert --scale x -- "
.RE
You may change the value of these options to change the way the generation
is done.
.BR " and "
will be replaced by
.B llgal
at runtime with the filename of the original and generated target images.
.BR " and "
will be replaced by the maximal width and length of the generated images.
Note that one of them might not be limited (depending on other configuration
variable), making it be replaced by an empty string, eventually leading to
empty parameters being passed to your program.
If your program does not like that, you might want to create a wrapper shell
script which will take care of accepting these.
Another solution would be to replace
.I unlimited
with
.I limited by a huge value
in your configuration and adapt your program to deal with it.
.SH TEMPLATES
When generation web pages, the following fields will be replaced
from the templates by the associated value (computed by llgal).
.B
.RS
The title of the index.
.RE
.B
.RS
The CSS style-sheet.
.RE
.B
.RS
The credits line given by
.I credits_text
configuration option.
.RE
.B
.RS
The version of the program used to generate the gallery.
.RE
.B
.RS
The filename of the index.
.RE
.B
.RS
The label of the link to the index (might be an image).
.RE
.B LLGAL-CODESET
.RS
The character encoding, usually set to iso-8859-1 or utf-8.
.RE
.B LLGAL-OPTIONS
.RS
The options that were passed to llgal on the command line
to generate the gallery.
.RE
When generating the index from template
.IR indextemplate.html ,
the following additional fields will also be replaced.
.B
.RS
The list of headers that are given in the captions file.
.RE
.B
.RS
The list of footers that are given in the captions file.
.RE
When generating slides from template
.IR slidetemplate.html ,
the following additional fields will also be replaced.
.B
.RS
The title of the slide.
.RE
.B
.RS
The style of the slide contents (is defined in the CSS style-sheet).
.RE
.B
.RS
The index of the slide, with leading zeros.
.RE
.B
.RS
The amount of slides.
.RE
.B
.RS
The slide counter according to slide_counter_format as in the caption.
.RE
.B
.RS
The caption of the slide.
.RE
.B
.RS
The table of EXIF tags.
.RE
.B
.RS
The actual contents of the slide (might be an image).
.RE
.BR " and "
.RS
The filename of the previous and next slides.
.RE
.BR " and "
.RS
The label of the link to previous and next slides (might be an image).
.RE
Additionally, it is possible to define use custom fields in the
templates and define their replacement with some
.B REPLACE
entries in the captions file.
See
.B CAPTIONS
for details.
When modifying the templates, beware that the HTML syntax requires
double-quotes around filenames, URL, etc. These double-quotes will
never be automatically added when replacing these automatic variables.
So you must keep double-quotes around variables when needed, for instance:
.RS
.B
.RE
will be changed into
.RS
.B Next slide
.RE
.SH LANGUAGE
The language that llgal uses to generate text in HTML pages is chosen
from the localization configuration.
If the chosen language is available in llgal translations, it will be
used instead of the default english.
As usual with
.BR gettext ,
it is possible to override the
localisation configuration by changing
.BR LANG ", " LC_MESSAGES " or " LANGUAGE
environment variables.
If the desired language is not available in llgal translations,
or if the user wishes to change the text values, he might create an
additional configuration file (or modify the system-wide one) to
update all configuration options of the
.B Text
section.
The locale configuration might be overridden with the
.B --lang
option or
.B language
configuration option.
But, the
.B LANGUAGE
environment variable appears to prevent this from working if set.
.SH CHARACTER ENCODING
If a filename contains non-ascii characters which are not safely
representable in a URL, llgal will escape them using the method RFC
2396 specifies.
This may raise problems if the web server has a different notion
of character encoding than the machine llgal runs on.
See also
.I http://www.w3.org/TR/html4/appendix/notes.html#h-B.2
Character encoding is chosen from the locale configuration and set in
the HTML headers.
It may be overridden by using
.B --codeset
or the
.B codeset
configuration option.
.SH NOTES
Note that all numerical options may be resetted to their default value
by setting them a negative value.
.SH FILES
.RE
.IR /etc/llgal/llgalrc ", " $HOME/.llgal/llgalrc ", " .llgal/llgalrc
.RS
System-wide, per-user and local configuration files. See
.B CONFIGURATION
for details.
.RE
.I /usr/share/llgal/captions.header
.RS
Captions syntax description file that is inserted at the top
of generated captions file.
.RE
.I /usr/share/llgal/llgal.css
.RS
The default style-sheet template.
.RE
.I /usr/share/llgal/tile.png
.RS
The tiled image used for the film effect.
.RE
.I /usr/share/llgal/index.png
.RS
The link image used for the index.
.RE
.I /usr/share/llgal/prev.png
.RS
The link image used for the previous slide.
.RE
.I /usr/share/llgal/next.png
.RS
The link image used for the next slide.
.RE
All files are required on the website.
llgal will copy them to the local
.I .llgal/
file during gallery generation.
.RE
.I /usr/share/llgal/indextemplate.html
.RS
The default index template file.
.RE
.I /usr/share/llgal/slidetemplate.html
.RS
The default file used to generate slides.
.RE
These files are not required on the website.
But, llgal will use them to generate HTML webpages of the gallery
by replacing several fields with text or images.
See
.B TEMPLATES
for details.
The user may change all these templates by storing files with
the same name in its user template directory
.I $HOME/.llgal/
or in the local
.I .llgal/
directory.
The former defines user-specific templates that will be used
each time the user generate a gallery.
The later defines gallery-specific templates that will be used
for the local gallery.
A local template is used by default if it exists.
A user template is used if it exists and no local template exists.
Finally, system-wide templates are used if no local and user
templates override them.
It is also possible to add custom template directories (with
.BR --templates )
that will be used to get templates before trying in the user
and in the system-wide template directories.
The option
.B --gt
might be used to get copies of template files in the local
or in the user template directory.
.SH EXAMPLES
Run
.B llgal
in a directory with
.IR jpg ", " gif ", " png ", " mpg " or " avi
files to see what it does. Then
play with the options described above and use
.B -h
if you need a quick listing.
.SH BUGS
There are always some. If you find any let me know.
.SH SEE ALSO
.PP
.BR llgalrc (5)
.SH AUTHOR
Brice Goglin
llgal-0.13.17/README 0000644 0001750 0000144 00000003576 11615752214 013215 0 ustar bgoglin users llgal installation instructions
===============================
You don't care about this if you use Debian or Gentoo prepackaged
versions that are available on http://bgoglin.free.fr/llgal.
Run 'make' followed by 'make install' as root.
If you don't want or can't install as root, you may use
'make install DESTDIR=/home/login/where/you/want'.
Note that you need to pass the same DESTDIR parameter
during compilation (with 'make') since the installation
directory is hardcoded in llgal.
By default, everything is installed in /usr/local/.
Most directories might be replaced by overriding their default values
on the command line.
For instance, a traditional installation might be achieved with
make install PREFIX=/usr SYSCONFDIR=/etc MANDIR=/usr/share/man \
LOCALEDIR=/usr/share/locale
Note that 'make uninstall' (with same options) allows to uninstall.
llgal requirements
==================
llgal requires perl and imagemagick packages.
The following perl libraries are also needed:
* Image::Size
* URI
* Locale::gettext
These dependencies are automatically installed when installing
Debian or Gentoo prepackaged versions.
Additionally, some options (--cc, --ct and --exfi) require the following
library to extract tags from images:
* Image::ExifTool
If not installed, llgal with work fine as long as none of these options
is used. When on is called, llgal will issue an error message advicing
to install the library.
If you need to install these libraries by yourself, you may
for instance find them on CPAN:
* http://search.cpan.org/~exiftool/Image-ExifTool-6.00/lib/Image/ExifTool.pod
* http://search.cpan.org/~rjray/Image-Size-2.992/Size.pm
* http://search.cpan.org/~gaas/URI-1.35/URI.pm
* http://search.cpan.org/~pvandry/gettext-1.05/gettext.pm
llgal is known to work with these versions.
If you experience any problem,
please see http://home.gna.org/llgal
or report to .
llgal-0.13.17/doc/ 0002755 0001750 0000144 00000000000 11615752213 013070 5 ustar bgoglin users llgal-0.13.17/doc/Makefile 0000644 0001750 0000144 00000000540 10524651447 014532 0 ustar bgoglin users .PHONY: install uninstall
install:
install -d -m 0755 $(DOCDIR)
find . -type d -exec install -d -m 0755 $(DOCDIR)/{} \;
find . -type f -not -name Makefile -exec install -m 0644 {} $(DOCDIR)/{} \;
uninstall:
find . -type f -not -name Makefile -exec rm -f $(DOCDIR)/{} \;
find . -depth -type d -exec rmdir $(DOCDIR)/{} \;
rmdir $(DOCDIR) || true
llgal-0.13.17/doc/howto.html 0000644 0001750 0000144 00000053171 11615751417 015130 0 ustar bgoglin users
llgal - On-line gallery generator - How-To?
llgal How-To?
This How-To is available on-line
and in the tarball and distribution packages.
You may add or remove some images in the working directory, and re-run
llgal with different options to update the gallery contents
or layout.
If an image has been modified, you may have to force the regeneration
of thumbnails and scaled images with -f.
to limit the height of the image to 480 pixels in slides.
Note that a click on the slide will actually open the
original full-size image.
You may even ignore the original images completely by passing
--nf so as to remove links from slides' scaled images
to the original unscaled full images.
You may set the title on the command line through:
llgal --title "My title"
To change captions, the easiest way is to ask llgal
to generate captions first, with:
llgal --gc
Then, you may edit the captions file (.llgal/captions)
to update all captions.
You then run llgal again, it will detect the existence
of the captions file and use it.
When generating the captions file with --gc, llgal
may automatically generate several fields for each image.
Available fields are image comments, filename and
image timestamp.
llgal will try to generate each field and concat them
to create the caption.
To generate captions from the filename only, run:
llgal --gc --cf
To generate captions from the image timestamp (extracted from
Exif tags when existing) and filename:
llgal --gc --cf --ct
To generate captions from the image comments (extract from
JFIF or Exif), timestamp and filename:
llgal --gc --cc --cf --ct
These commands will generate a captions file that you might then
use when generating the gallery.
You might also directly generate captions during the gallery
generation through something like:
llgal --cc --ct
Note that if a captions file exists, command line options about
captions generation are omitted.
Also note that --cc and --ct require the
Image::ExifTool Perl module to be installed.
After generating the captions file with --gc, you might add
a special slide containing only some text by inserting the following
line in the file:
TXT: the text that is shown in the slide ---- the caption under the slide
Regenerating the gallery will then add this slide.
The following line add a special slide with a link instead of plain text:
LNK: the url ---- the label of the link in the slide ---- the caption under the slide
If you do not want those slides containing a single link or text to appear like this,
you may use -L so that they will be listed as a text line in the index.
You may also use LNKNOSLIDE: entries to add links without slides.
Re-running llgal with --gc will rescan the existing files and
add the missing ones at the end of the captions file.
You then re-run llgal to update the gallery regarding the new captions file.
The captions file may also be used to keep track of the contents of a gallery.
Even if you do not add some captions or title in the captions file, you may use
it to list the exact set of images that you want to appear in the gallery.
The order of the slides might be changed with the sort option
on command-line.
For instance, --sort=iname sorts by name case insensitively,
while --sort=revdate sorts by date, in reverse order.
It is also possible to set the order by changing captions positions
in the captions file.
By default, llgal does only include images and movies in the
gallery.
It is possible to force it to use all existing files in the directory
(except *.html and .*) with:
llgal -A
It is also possible to exclude some files with --exclude regexp
where regexp is a Perl regexp. For instance, to exclude all
AVI files starting with MVI:
llgal --exclude 'MVI.*\.AVI'
File that were excluded might be reincluded by using the similar
--include option.
Finally, it is always possible to exclude files by generating a captions
file and removing some entries.
Note that the captions file is a good way to keep the list of images that
are involved in the gallery, even if you do not want any caption.
The main layout of generated webpages is based on HTML templates
(indextemplate.html and slidetemplate.html)
and a CSS style-sheet (llgal.css).
It is possible to place modified versions of these files in the .llgal
directory (or in $HOME/.llgal/) to change the layout.
Since converting images might be slow, llgal does
not always regenerate thumbnails and scaled images. By default, it only does if the
original images has been changed since last generation.
To force regeneration, for instance if you changed the thumbnails (with --tx
or --ty) or scaled images dimensions (with --sx or --sy),
you may use -f (or force_image_regeneration).
By default, the width and height of thumbnails are both limited. Both dimension
limits may be changed with --tx or --ty, but changing a single
one does affect the other one. It means that the other should be changed too in
most of the circumstances.
Note that changing one of these options requires to
force regeneration of thumbnails.
llgal has been designed to create fixed-size slides. If, instead, you would like your
images in slides to follow the size of the window, you may use the slide_dimensions_from_css
option, either from a configuration file or with --option on the command line.
llgal will then remove all absolute dimensions for images in HTML slides.
Finally, you will be able to set the image width through the CSS slide sheet (llgal.css),
for instance by adding width: 100% in table.slide td.image-slide img.
All text that appears in generated slides might be configured through configuration
options.
One day, there might be a full internationalization support through gettext.
All non-image slides and thumbnails are usually basic text.
It is possible to force llgal to use a special thumbnail or scaled image
by adding a special file in the local .llgal directory with prefix
mythumb_ or myscaled_.
For instance, mythumb_image24.jpg will be used as a thumbnail for image
image24.jpg.
mythumb_subdir3.jpg will be used for sub-directory subdir3.
And myscaled_bar.avi.jpg will be used as a scaled image for movie bar.avi.
The extension for the thumbnail or scaled image may be any image extension
that llgal recognizes.
Most images contains some meta-data called EXIF tags that may be useful to some people.
llgal can display a table of some EXIF values under each image slide.
The name of the tags correspond to what the exiftool program uses
(see for instance exiftool --list).
If you like using the same options for all your galleries and don't
want to remember the option, you may ask llgal to generate
a configuration file with:
llgal --gencfg my_llgalrc
This file might be used later with
llgal --config my_llgalrc
It may also be placed in the user llgal configuration file
$HOME/.llgal/llgalrc.
The configuration file contains a list of configuration lines.
All command line options, and even much more, are available by
this way.
It is possible to pass any configuration option on the
command line with --option.
For instance, to set which file extensions llgal will
match to find movies, use:
If your photos are organized in several subdirectories of the working directory,
you can use -P to take the photos from them instead of from the working
directory.
llgal -P subdir1 -P subdir2 -P subdir3
If you want these subdirectories to appear as sections, llgal can generate
a horizontal line between each subdirectory and add a title in the index with --Ps.
Additionally, llgal can display the title as regular text in the index instead
of a text thumbnail with -L.
llgal -P subdir1 -P subdir2 -P subdir3 --Ps -L
As usual, these horizontal lines and titles are generated as TXT and LINE entries
are processed from the captions file. Thus, you may start by creating a captions file,
edit it and then generate the gallery.
You may a the list of files of a subdirectory to an existing gallery if its
captions file if available, by regenerating it:
llgal -P newsubdir --gc
The directory contents is added at the end of the captions file, which may
be reordered by the user.
The gallery may then be regenerated from the new captions file by re-running
llgal.
If your directory contains subdirectories, you might use -S
to create slides linking to these subgalleries.
With -R, the subgalleries will even be generated right after
the main gallery.
The list of subgalleries might be changed by modifying DIR:
entries in the captions file.
Galleries that were created recursively (with -R) may be
linked with their parents, children and brothers.
If you plan to regenerate some galleries independently, you should
take care of saving the configuration with --gencfg or
generating a captions file.
All linking information is stored inside these files.
Regeneration is then easy (with --config in the first case).
Assuming you have a main directory containing multiple subdirectories where you
already created sub-galleries, you may do:
llgal -L -s
Using -L will create text links instead of thumbnails linking to sub-galleries,
while -s will avoid any slide to be created.
As you may want slides in the sub-galleries, adding -R is not recommended here
since -s would remove slides from both the main gallery and the sub-galleries.
If you need -R anyway, you may for instance avoid this problem by dropping
-s on the command and inserting make_no_slides=1 in the main gallery
configuration file (.llgal/llgalrc).
Since the local configuration file is used for the local gallery and not for
sub-galleries (even with -R), make_no_slides=1 won't
affect sub-galleries.
The HTML accesskey feature may be use to navigate in llgal's
galleries with keyboard shortcuts. But as this feature is very browser
dependant and might conflict with some regular shortcuts in certain
browsers, it is not enabled by default in llgal.
Access keys can be configured by changing the templates and adding
accesskey=<letter> to links.
For instance, changing the slidetemplate.html code to the
following one will define p, n and i as
accesskeys to previous slide, next slide and return to the index.
It means that Alt+p, Alt+n and Alt+i will
be the actual shortcuts in Mozilla Firefox.
llgal --clean erases all files that have not been modified regarding to their
original template. The captions file does not have a template, so llgal
will only erase it if it contains the following line:
# REMOVE THIS LINE IF LLGAL SHOULD NOT REMOVE THIS FILE
When the user generates the captions file himself, he is not supposed
to add this line, which means llgal won't erase the file.
But, when the captions are generated with llgal --gc, this line will be added
automatically. Hence, if the user modifies the captions file, he should start
by removing this line first to protect his modifications from future erasing.
Note that llgal --cleanall erases ALL files, even if you kept the above line
in the captions file.
The --php option of llgal enables generation of PHP slides
instead of HTML. By default, no PHP code is inserted. But, you may change the
templates to add some PHP code to do whatever you want, including handle
dynamic comments that people may add to your slides.
llgal comes with some examples, including the directory
dynamic_comments_in_slides/ which describes how exactely to do so.
llgal uses ImageMagick (and especially convert) to generate
thumbnails (and scaled images if --sx or --sy was passed). It can be
pretty long if you have lots of large images.
To avoid being slow everytime you re-run llgal, thumbnails and scaled images
are only generated once
(except when the original has been modified since or when -f is passed, see
Why does llgal ignore the image dimension limits that I give?).
There might be some way to improve the overall speed of thumbnails and scaled images
generation by changing the corresponding command line with scaled_create_command
and thumbnail_create_command in the configuration file. You may for instance use
another conversion program which is more optimized than ImageMagick to process
your specific images.
See tweak_image_generation.txt in the examples in the documentation for details.
llgal is only a gallery generator. Adding features to rotate images (for instance
using Exif tags) or modify images (for instance to apply some filters) would open the door
for thousands of options that llgal does not really require (and the command line
interface is already pretty complex). We prefer keeping those features in other softwares
that the user runs before using llgal. Also, there is no technical reason to
include such filters in llgal. Applying them with another specialized software
before generating the gallery is as easy, and such software will ever provide more features
than llgal.
llgal is not supposed to be used for this
(see Why does llgal not provide any feature to rotate or modify images?).
You should use an external tool earlier and then apply llgal on the scaled images.
If you really want to use llgal to scale images down, you should use --sx
and/or --sy. The scaled images will be placed in .llgal/scaled_*.
To drop the originals and use the scaled images directly, you should first remove the
originals from the main directory. Then move the scaled images from .llgal to
the main directory and remove the scaled_ suffix
(rename 's@^\.llgal/scaled_@@' .llgal/scaled_* should do the trick).
Finally, re-run the same llgal command line without --sx and/or
--sy.
You should get the same gallery as before, without the links from the slides to the
original images.
llgal-0.13.17/doc/llgalrc 0000644 0001750 0000144 00000030513 11615751417 014440 0 ustar bgoglin users # llgal configuration options.
# These options may be defined in /etc/llgal/llgalrc, a per-user
# ${HOME}/.llgal/llgalrc file or a directory-specific .llgal/llgalrc.
# Most of these options may later be overridden by command line options.
# Default are shown in examples below.
# Syntax is one of these:
# variable = "string"
# variable = decimal number
# variable = 0 or 1 for disabling or enabled
# For now, only static values are supported.
# Brackets indicate corresponding command line options.
##### Name of generic llgal files #####
# Name of the captions header file that is inserted at the beginning
# of generated captions files.
# captions_header_filename = "captions.header"
# Name of the CSS file.
# Such a file will be stored under $local_llgal_dir.
# css_filename = "llgal.css"
# Name of the film tile image.
# Such a file will be stored under $local_llgal_dir.
# Note that this filename must match the one that is used in the CSS file.
# filmtile_filename = "tile.png"
# Name for image link to the index, previous or next slide
# index_link_image_filename = "index.png"
# prev_slide_link_image_filename = "prev.png"
# next_slide_link_image_filename = "next.png"
# Name of the index template.
# Such a template file will be used during gallery generation.
# indextemplate_filename = "indextemplate.html"
# Name of the slide template.
# Such a template file will be used during gallery generation.
# slidetemplate_filename = "slidetemplate.html"
##### Location of llgal files if available on the web #####
# Location of the CSS file if available on the web [--uc ].
# If ending with '/', css_filename will be added.
# css_location = ""
# Location of llgal image files if available on the web.
# If ending with '/', their generic filename will be added.
# These locations may be set alltogether with --ui .
# filmtile_location = ""
# index_link_image_location = ""
# prev_slide_link_image_location = ""
# next_slide_link_image_location = ""
##### Location and name of generated files #####
# Local subdirectory where llgal files generated files will be stored.
# This option is only available in system- and user-wide configuration
# files.
# Note that HTML files are generated in place while captions and CSS
# are kept in this subdirectory.
# Gallery specific HTML templates and llgalrc configuration file
# might also be defined here.
# local_llgal_dir = ".llgal"
# Name of the generated index file [-i ]
# index_filename = "index"
# Prefix of generated HTML slide filenames
# Note that this prefix is used to decide what HTML to delete when --clean
# is passed. Setting this option to an empty string will make llgal remove
# all HTML files.
# slide_filenameprefix = "slide_"
# Prefix used to determine the filenames of scaled image that are
# shown in slides (in case of --sx or --sy).
# These files will be stored under $local_llgal_dir.
# scaled_image_filenameprefix = "scaled_"
# Prefix used to determine thumbnail filenames from original images.
# These files will be stored under $local_llgal_dir.
# thumbnail_image_filenameprefix = "thumb_"
# Name of the captions file that will be generated when llgal is called
# with --gc. This file will be stored under $local_llgal_dir.
# captions_filename = "captions"
# Additional prefix of user-provided scaled images
# user_scaled_image_filenameprefix = "my"
# Additional prefix of user-provided thumbnails
# user_thumbnail_image_filenameprefix = "my"
# Character to use to replace / in the thumbnail/scaled of subdir images
# path_separator_replacement = "@"
##### Index #####
# Cellpadding in the index table [-p ]
# Must be >= 0, setting to < 0 resets to default
# index_cellpadding = 3
# Display links and text as regular text instead of thumbnails
# in the main gallery thumbnail index [-L]
# list_links = 0
# Pixels per row of thumbnails in index [--wx ]
# Must be > 0, 0 means unlimited, setting to < 0 resets to default
# pixels_per_row = 0
# Thumbnails per row in index [-w ]
# Must be > 0, 0 means unlimited, setting to < 0 resets to default
# thumbnails_per_row = 5
# Maximal height of thumbnails [--ty ]
# Must be > 0, setting to < 0 resets to default
# Changing this value does not affect the maximal width (see thumbnail_width_max)
# thumbnail_height_max = 75
# Maximal width of thumbnails [--tx ]
# Must be > 0, 0 means unlimited, setting to < 0 resets to default
# Changing this value does not affect the maximal height (see thumbnail_height_max)
# thumbnail_width_max = 113
# Write captions under thumbnails [-u]
# show_caption_under_thumbnails = 0
# Show a film effect in the index of thumbnails [--fe]
# show_film_effect = 0
# Make thumbnail links point to the target object instead of
# the corresponding slide
# MVI_link_to_target = 0
# FIL_link_to_target = 0
# DIR_link_to_target = 0
# LNK_link_to_target = 0
##### Slides #####
# Make no slides [-s]
# make_no_slides = 0
# Use filename as slide filename [-n]
# make_slide_filename_from_filename = 0
# Also use extension in the slide filename to differenciate
# slide filename of images that have same filenames.
# make_slide_filename_from_extension = 0
# Do not output any absolute image size in the HTML code and assume the
# CSS style sheet will take care of it (in table.slide td.image-slide img)
# slide_dimensions_from_css = 0
# Maximal width of slides [--sx ]
# Must be > 0, 0 means unlimited, setting to < 0 resets to default
# slide_width_max = 0
# Maximal height of slides [--sy ]
# Must be > 0, 0 means unlimited, setting to < 0 resets to default
# slide_height_max = 0
# Default size of non-image slides.
# Must be > 0, setting to < 0 resets to default
# Note that the --sx and --sy options may lead to reduction of these values.
# text_slide_width = 400
# text_slide_height = 300
# Use an image instead of a text label for the link to the index,
# previous or next slide [--li]
# index_link_image = 0
# next_slide_link_image = 0
# prev_slide_link_image = 0
# Use a thumbnail preview instead of a text label for the link
# to the previous or next slide [--lt]
# next_slide_link_preview = 0
# prev_slide_link_preview = 0
# Generate slide titles from captions [-k]
# make_slide_title_from_caption = 0
# Generate links between last and first slides or galleries.
# link_between_last_and_first = 1
# Display a table of EXIF tags under each image slide [--exif]
# The tags are given with their name in exiftool -list and separated
# with a comma.
# show_exif_tags = ""
# Display a table of all available EXIF tags under each image slide [--exif]
# show_all_exif_tags = 0
##### Captions #####
# This line will be added to the captions file llgal will generate when
# called with --gc. If the user doesn't want llgal to remove this captions
# file when called with --clean, it just needs to remove this line from
# the file.
# captions_removal_line = "REMOVE THIS LINE IF LLGAL SHOULD NOT REMOVE THIS FILE"
# Generate captions from comment stored in images [--cc []]
# make_caption_from_image_comment = ""
# Also generate captions from timestamp stored in images [--ct]
# make_caption_from_image_timestamp = 0
# Generate captions from filenames without their extension [--cf]
# make_caption_from_filename = 0
# Generate captions from filenames with their extension
# make_caption_from_extension = 0
# Show dimensions and/or size of the images and movies [-a, --ad, --as]
# show_dimensions = 0
# show_size = 0
# Change the format of the counter shown on the slides
# %n is replaced by the slide number, %0n gets leading zeros,
# and %t is replaced by the number of slides.
# Setting to "" disables the slide counter [--nc]
# slide_counter_format = " (%0n/%t)"
##### Text #####
# Default title of the gallery.
# May be overridden with [--title ] or TITLE: in the captions file.
# index_title_default = "Index of pictures"
# Change text in links to parent directory.
# parent_gallery_link_text = "Back to parent gallery"
# Change text in links to previous gallery.
# prev_gallery_link_text = "Previous gallery "
# Change text in links to next directory.
# next_gallery_link_text = "Next gallery "
# Label of the link from a slide to the index
# index_link_text = "Index"
# Label of the link from a slide to the previous one
# prev_slide_link_text = "<<Prev"
# Label of the link from a slide to the next one
# next_slide_link_text = "Next>>"
# Text prefixing the filename when generating link text
# for movies without a captions file.
# MVI_link_text = "Open movie "
# Text prefixing the filename when generating link text
# for files without a captions file.
# FIL_link_text = "Download file "
# Text prefixing the filename when generating link text
# for directories without a captions file.
# DIR_link_text = "Open subgallery "
# Text shown as image alternative for full-size images in slides
# alt_full_text = ""
# Text shown as image alternative for scaled images in slides
# alt_scaled_text = "Scaled image "
# Text shown as image alternative for thumbnails in the index
# alt_thumbnail_text = "Thumbnail "
# Text shown as an image alternative for the film tile in the index
# alt_film_tile_text = "Film tile"
# Text shown when the mouse pointer is over a scaled image in a slide
# over_scaled_text = "Click to see full size "
# Text shown when the mouse pointer is over a thumbnail
# over_thumbnail_text = "Click to enlarge "
# Text shown when the mouse pointer is over a link from a slide to the index
# over_index_link_text = "Return to the index"
# Text shown when the mouse pointer is over a link from a slide to the previous one
# over_prev_slide_link_text = "Previous slide "
# Text shown when the mouse pointer is over a link from a slide to the next one
# over_next_slide_link_text = "Next slide "
# Unit to be used when printing sizes [--asu ]
# show_size_unit = "kB"
# Set timestamp format in captions (when enabled) using strftime format [--ct ]
# timestamp_format_in_caption = "%Y-%m-%d %H:%M:%S"
# Credits line at the bottom of the index
# credits_text = "created with llgal"
##### What files to insert in the gallery #####
# Extensions that are matched when searching images (|-separated list)
# image_extensions = "jpg|jpeg|gif|png|tif|tiff|bmp"
# Extensions that are matched when searching movies (|-separated list)
# movie_extensions = "mpg|mpeg|avi|mov|ogm|wmv"
# Add all files to the list of entries
# not only images and movies [-A]
# add_all_files = 0
# Add subdirectories to the list of entries [-S]
# add_subdirs = 0
# Exclude files whose name matches [--exclude ]
# This option may be used several times.
# exclude = "regexp"
# Include files whose name matches and were previously excluded [--include ].
# This option may be used several times.
# The order of includes and excludes is respected.
# include = "regexp"
# Sort criteria when scanning files in the working directory [--sort]
# sort_criteria = "name"
##### Sections #####
# Add a new subdirectory to the list of sections [-P]
# section_dir = "subdir"
# Add all subdirectories to the list of sections [--Pall]
# recursive_sections = 0
# Add the subdirectory name as a title at the beginning of each section [--Ps]
# entitle_sections = 0
# Add a horizontal line at the beginning of each section in the index [--Ps]
# separate_sections = 0
##### Recursion #####
# Run recursively in subdirectories [-R]
# recursive = 0
# Add links between subgalleries [--Rl]
# link_subgalleries = 0
# Add links to the parent directory [--parent-gal]
# parent_gallery_link = 0
##### Various #####
# Additional configuration file [--config ]
# This option may be used multiple times.
# additional_configuration_file = "my_llgal.rc"
# Additional template directories [--templates].
# This option may be used multiple times.
# additional_template_dir = "path"
# Codeset to be set in HTML headers [--codeset ]
# codeset = "codeset"
# Language to be used for generated text in HTML pages [--lang ]
# If set, the LANGUAGE environment variable might prevent this option from working.
# language = "locale"
# Command to be used to generate scaled images and thumbnails
# thumbnail_create_command = "convert -scale x -- "
# scaled_create_command = "convert -scale x -- "
# Force regeneration of thumbnails and scaled images [-f].
# force_image_regeneration = 0
# Print notice messages [-v]
# verbose = 0
# Give access rights for www access [--www]
# www_access_rights = 0
# Extension of generate webpages [--php]
# www_extension = "html"
llgal-0.13.17/doc/upgrade.html 0000644 0001750 0000144 00000011616 11342262412 015402 0 ustar bgoglin users
How-to upgrade a gallery from igal to llgal?
How-to upgrade a gallery from igal to llgal?
This upgrade documentation is available on-line
and in the tarball and distribution packages.
File location
igal places all files in the working directory with existing images.
.captions
.indextemplate.html
.slidetemplate.html
.slide_<image>
.thumb_<image>
.tile.png
igal.css
llgal moves all these files in a .llgal, making the starting dot useless.
.slide_<image> is also replaced by .scaled_<image>.
.llgal/captions
.llgal/indextemplate.html
.llgal/slidetemplate.html
.llgal/scaled_<image>
.llgal/thumb_<image>
.llgal/tile.png
.llgal/llgal.css
Note that earlier versions of llgal use .llgal.files instead of .llgal.
CSS style sheet
The CSS style sheet has been updated. If you modified it, you should probably
diff against the original igal.css, and apply the difference (by hand)
to llgal.css.
Command line options
All long options (more than one character) now requires a double dash.
igal -clean is now llgal --cleanall
since llgal --clean only removes file that have not been modified.
Captions generation uses --gc instead of -c.
The caption is automatically used if it exists, -c is not used anymore.
Captions generation from filename is --cf instead of -C.
Do not show image counter in captions is now --nc instead of -x.
The film effect in the index of thumbnails is now disabled by default. Instead of
disabling it with -r, you may now enable it with --fe.
--sp and --tp options got removed.
But scaled_image_filenameprefix and thumbnail_image_filenameprefix
configuration options allow prefix modification.
-bigy (limit image height in slides) is replaced with --sy.
-y (limit thumbnail height) is replaced with --ty.
-t has been removed, the user just need to modify the tile.png image
to get an updated layout.
--con has been removed, image generation command line may now be configured
by changing scaled_create_command and thumbnail_create_command configuration options.
How-to upgrade
If you don't care about processing time:
Save your .captions file if it exists
Note the command line you used when creating the gallery
(see in the header of index.html)
Remove everything but the images with igal -clean
Create a .llgal directory and move your captions files inside
(remember it is now named captions instead of .captions)
Run llgal with same options (see section 3 for details)
Recomputing the whole gallery might be long, especially if you have tons of images,
since thumbnails (and scaled images if --bigy/--bigxy is passed)
have to be generated.
If you don't want to regenerate these, see section File location
and move .thumb_* and .slide_* files
to .llgal/thumb_* and scaled_* so that llgal uses them.
llgal-0.13.17/doc/examples/ 0002755 0001750 0000144 00000000000 11615752213 014706 5 ustar bgoglin users llgal-0.13.17/doc/examples/tweak_image_generation.txt 0000644 0001750 0000144 00000001043 10524651447 022140 0 ustar bgoglin users By default, llgal uses convert to generate thumbnails and scaled images
from your original images. You may change how the generation is done
in order to either:
* replace convert with a specific image processing library that might be more
optimized for your specific images.
* apply some effects, for instance drop a shadow.
It may be achieved by changing the values of scaled_create_command and
thumbnail_create_command options in a configuration file. See the section
THUMBNAILS AND SCALED IMAGES GENERATION in the manpage for details.
llgal-0.13.17/doc/examples/dynamic_comments_in_slides/ 0002755 0001750 0000144 00000000000 11615752213 022270 5 ustar bgoglin users llgal-0.13.17/doc/examples/dynamic_comments_in_slides/add_comment.php 0000644 0001750 0000144 00000001605 10515510127 025245 0 ustar bgoglin users \n", $new_comment);
/* change escaped quotes into non-escaped */
$new_comment = str_replace("\'", "'", $new_comment);
$new_comment = str_replace('\"', '"', $new_comment);
/* open the comment file */
$fp = fopen ($comment_file, "a")
or die ("Couldn't open the file to add comment for ".$slide_url."\n");
/* lock it to protect against concurrent accesses */
flock($fp, LOCK_EX);
/* Add the comment and format it */
fwrite($fp, "New comment: \n");
fwrite($fp, "".$new_comment."");
fwrite($fp, " \n");
/* unlock and close the file */
flock($fp, LOCK_UN);
fclose ($fp);
/* go back to the slide */
header("Location: ".$slide_url);
?>
llgal-0.13.17/doc/examples/dynamic_comments_in_slides/README 0000644 0001750 0000144 00000002110 10515512772 023142 0 ustar bgoglin users How do I let people add comments to my slides dynamically?
==========================================================
Some PHP code may be used to handle dynamic comments in slides.
The slide template in this directory should be used together with
llgal --php. It will generate PHP slides with comments stuff at the
bottom:
* slide_.php displays the contents of comments_.txt if it exists
* a form is available to add new comments in comments_.txt
Look at the bottom of slidetemplate.html to see the relevant code.
The PHP script add_comments.php in this directory is executed when
the form Submit button is clicked. It will format the comment text,
add it to the corresponding comments_.php, and go back to the
slide.
Of course, this is just a very simple example. It may be improved
a lot by adding other fields in the form (especially the name and
email of the author of the comment) and the date.
Right now, formatting is done when the comment is added. But some
people might want to keep comments_.txt unformatted and have
slide_.php format the text when displaying it.
llgal-0.13.17/doc/examples/dynamic_comments_in_slides/slidetemplate.html 0000644 0001750 0000144 00000004321 10515512772 026012 0 ustar bgoglin users