.\" Automatically generated by Pandoc 3.1.3 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "LAZYGAL" "1" "" "" "" .hy .SH NAME .PP lazygal - static web gallery generator .SH SYNOPSIS .PP \f[B]lazygal\f[R] \f[B]-h\f[R] | \f[B]-v\f[R] | options albumdir .SH DESCRIPTION .PP This manual page explains the \f[V]lazygal\f[R] program. This program is a static web gallery generator written in Python. .PP \f[V]lazygal\f[R] works so: you should have an original store of files - possibly containing subdirectories (their names serving as headings if not using the album metadata feature). This is the source file hierarchy. It will never be modified by \f[V]lazygal\f[R]. Then, when launching: .PP \f[V]$ lazygal -o /var/www/MyAlbum /home/user/SourceDir\f[R] .PP \f[V]lazygal\f[R] will analyze the contents of the source hierarchy and will (re)create the target hierarchy, with all the bells and whistles defined by the templates. Only missing parts or parts that are not up to date will be generated. There is a limitation to this mechanism though: although updates in the source directory, in the metadata or in the themes are detected, changes in command line options and configuration files since last generation are not and the user should manually delete files that need to be generated again. .PP \f[V]lazygal\f[R] source directory crawling will follow symbolic links on directories so that you can arrange what you want to publish in any way that suits you without copying data around. .SH OPTIONS .PP These programs follow the usual GNU command line syntax, with long options starting with two dashes (\[ga]-\[aq]). A summary of options is included below. For a complete description, see the \f[V]-h\f[R] switch. .TP \f[V]-v\f[R] \f[V]--version\f[R] Show program\[aq]s version number and exit. .TP \f[V]-h\f[R] \f[V]--help\f[R] Show summary of options. .TP \f[V]--quiet\f[R] Don\[aq]t output anything except for errors. .TP \f[V]--debug\f[R] Output everything that lazygal is doing. .TP \f[V]-o DEST_DIR\f[R] \f[V]--output-directory=DEST_DIR\f[R] Directory where web pages, slides and thumbs will be written (default is current directory). .TP \f[V]-t THEME\f[R] \f[V]--theme=THEME\f[R] Theme name (looked up in theme directory) or theme full path. .TP \f[V]--default-style=DEFAULT_STYLE\f[R] Default style to apply to the theme. This is actually the filename (no extension) of the CSS stylesheet of the theme that is not marked as \f[V]alternate\f[R], thus should get used as default or preferred by the web browser. .TP \f[V]--template-vars=TPL_VARS\f[R] Common variables to load all templates with, e.g. \f[V]--template-vars=\[aq]footer=foo bar,color=baz\[aq]\f[R]. For longer variable contents, it is easier to use a configuration file (see LAZYGAL-CONF). .TP \f[V]-f\f[R] \f[V]--force-gen-pages\f[R] Force rebuild of web pages, regardless of the modification times of their dependencies. This is handy when changing a configuration option affecting these (theme, directory flattening, etc.). .TP \f[V]--clean-destination\f[R] Clean destination directory of files that should not be there. .TP \f[V]--preserve=PATTERN\f[R] Specify a file pattern (or name) which should be ignored during cleanup of the destination. May be specified more than once. Values given here will be in addition to those specified in configuration files. .TP \f[V]--exclude=PATTERN\f[R] Specify a file pattern (or name) which should be ignored during processing. May be specified more than once. Values given here will be in addition to those specified in configuration files. .TP \f[V]--check-all-dirs\f[R] Exhaustively go through all directories regardless of source modification time. .TP \f[V]-s IMAGE_SIZE\f[R] \f[V]--image-size=IMAGE_SIZE\f[R] Size of images, define as name=xxy, ..., eg. small=800x600,medium=1024x768. The special dimensions 0x0 use original size. Refer to the IMAGE RESIZE DESCRIPTION section for more information on the available syntax. The number of sizes provided will define the number of sizes that will be generated: \f[V]--image-size=\[dq]medium=800x600\[dq]\f[R] will only generate all images for a medium size (no small size) \f[V]--image-size=\[dq]small=640x480,medium=800x600,large=1024x768\[dq]\f[R] will generate 3 sizes for all images (small, medium, large) .TP \f[V]-T THUMBNAIL_SIZE\f[R] \f[V]--thumbnail-size=THUMBNAIL_SIZE\f[R] Size of thumbnails, eg. 150x113. Refer to the IMAGE RESIZE DESCRIPTION section for more information on the available syntax. .TP \f[V]-q QUALITY\f[R] \f[V]--quality=QUALITY\f[R] Quality of generated JPEG images (default is 85). .TP \f[V]-O\f[R] \f[V]--original\f[R] Include original photos in output. .TP \f[V]--orig-base=RELATIVE_PATH\f[R] Do not copy original photos in output directory, instead link them using RELATIVE_PATH as base for those links (discarded without \f[V]-O\f[R]). .TP \f[V]--orig-symlink\f[R] Do not copy original photos in output directory, instead create symlinks to their original locations. This is useful when you plan transferring the whole directory which \[ga]\f[V]generated to some other location, perhaps with\f[R]rsync\[ga], and you wish to avoid creating an extra copy of each photo. .RS .RS .PP \f[B]Caution\f[R] .PP This option is not available on Windows; if you try to use it on that operating system, \f[V]lazygal\f[R] will immediately exit with an exit status of 1. .RE .RE .TP \f[V]--puburl=PUB_URL\f[R] Publication URL (only useful for feed generation). .TP \f[V]-m\f[R] \f[V]--generate-metadata\f[R] Generate metadata description files where they don\[aq]t exist in the source tree instead of generating the web gallery. This disables all other options. .TP \f[V]-n THUMBS_PER_PAGE\f[R] \f[V]--thumbs-per-page=THUMBS_PER_PAGE\f[R] Maximum number of thumbs per index page. This enables index pagination (0 is unlimited). .TP \f[V]--filter-by-tag=TAG\f[R] If set, lazygal will only export the pictures that have one of their (IPTC) tags matching TAG. It is also possible to use an equivalent of AND and OR boolean tests to filter tags. For more details, read below the section TAG FILTERING. .TP \f[V]--pic-sort-by=ORDER\f[R] Sort order for images in a subgallery, among \[aq]mtime\[aq], \[aq]filename\[aq], \[aq]numeric\[aq], or \[aq]exif\[aq]. (default is \[aq]exif\[aq] which is by EXIF date if EXIF data is available, filename otherwise, sorting EXIF-less images before). \[aq]numeric\[aq] does a numeric sort on the numeric part of the filename. Add \[aq]:reverse\[aq] to reverse the sort order (e.g.\ \f[V]--pic-sort-by=mtime:reverse\f[R]). .TP \f[V]--subgal-sort-by=ORDER\f[R] Sort order for subgalleries, among \[aq]exif\[aq] (EXIF date of the latest picture in sub-gallery), \[aq]mtime\[aq], \[aq]dirname\[aq], or \[aq]numeric\[aq] (default is \[aq]dirname\[aq]). \[aq]numeric\[aq] does a numeric sort on the numeric part of the dirname. Add \[aq]:reverse\[aq] to reverse the sort order (e.g.\ \f[V]--subgal-sort-by=dirname:reverse\f[R]). .TP \f[V]--dir-flattening-depth=LEVEL\f[R] Level below which the directory tree is flattened. Default is no flattening (\[aq]No\[aq]). .RS .PP This option makes the program include the web gallery index of child galleries in their parent\[aq]s gallery index, if their level is greater than the supplied LEVEL. The level of the album root is 0. .PP Index pages with multiple galleries (which happens when this section is used) show the pictures links in gallery sections. .PP The following examples show the produced indexes for a sample album (2 sub-galleries, 1 sub-sub-gallery, 1 picture in each one of those). .PP \f[B]Example 1. \[en]dir-flattening-depth=No\f[R] (default) .IP .nf \f[C] index.html <- sub-gallery links subgal1/index.html <- index with img1 subgal1/img1.html subgal1/subsubgal1/index.html <- index with img2 subgal1/subsubgal1/img2.html subgal2/index.html <- index with img3 subgal2/img3.html \f[R] .fi .PP \f[B]Example 2. \[en]dir-flattening-depth=0\f[R] .IP .nf \f[C] index.html <- contains index for all pics subgal1/img1.html subgal1/subsubgal1/img2.html subgal2/img3.html \f[R] .fi .PP \f[B]Example 3. \[en]dir-flattening-depth=1\f[R] .IP .nf \f[C] index.html <- contains index for all pics subgal1/index.html <- index with img1 and img2 subgal1/img1.html subgal1/subsubgal1/img2.html subgal2/index.html <- index with img3 subgal2/img3.html \f[R] .fi .RE .TP \f[V]-z\f[R] \f[V]--make-dir-zip\f[R] Make a zip archive of original pictures for each directory. .TP \f[V]--webalbum-pic-bg=WEBALBUMPIC_BG\f[R] Webalbum picture background color. Default is transparent, and implies the PNG format. Any other value, e.g.\ red, white, blue, uses JPEG. .TP \f[V]--webalbum-pic-type=WEBALBUMPIC_TYPE\f[R] What type of web album thumbnails to generate. By default, lazygal generates the well-loved \[dq]messy\[dq] thumbnails with randomly selected pictures from the album each rotated by a random amount and pasted together. This default can also be forced by specifying \[aq]messy\[aq] as WEBALBUMPIC_TYPE. .RS .PP On the other hand, specifying \[aq]tidy\[aq] as the value of this option forces lazygal to skip the rotations, resulting in more regularly shaped thumbnails which can also be more densely packed. This can be an advantage if not all users of your albums have huge screens :-) .RE .TP \f[V]--keep-gps-data\f[R] Do not remove GPS data from EXIF tags. By default the location tags are removed for privacy reasons. However, there are situations when having the location data makes sense and is desired. This is mostly meant to be used with holiday photos. .TP \f[V]--no-video\f[R] Do not process videos nor include them in indexes. .SH THEMES .PP A theme maps to a directory that contains the following items: .TP \f[V]theme/SHARED_*\f[R] Files to put in the web gallery directory \f[V]shared\f[R], e.g.\ CSS, Javascript, images or other resources common to all galleries. .TP \f[V]theme/browse.thtml\f[R] The XHTML template for the theme browse page (displaying one picture). .TP \f[V]theme/dirindex.thtml\f[R] or \f[V]theme/dynindex.thtml\f[R] The XHTML template for the directory index page (pictures and sub-galleries links). .PP Depending on which index file is present, the theme will be: .TP \f[V]dirindex.thtml\f[R]: fully static one HTML page per picture, per size and one index per size, or .TP \f[V]dynindex.thtml\f[R]: dynamic only one index per directory is to be generated. .PP \f[V]theme/*.thtml\f[R] must be valid XML. See \f[V]http://genshi.edgewall.org/wiki/Documentation/xml-templates.html\f[R] for syntax. Dependencies for statically included templates (i.e.\ with filenames not computed from variables) are automatically computed: when an included template is modified, the software will automatically figure out which pages to re-generate. Missing template files will be searched for in the \f[V]default\f[R] theme. .PP \f[V]theme/SHARED_*\f[R] files (common resources for the directory \f[V]shared\f[R]) are renamed to strip the \f[V]SHARED_\f[R] prefix and: .IP \[bu] 2 Processed using the Genshi text template engine (see \f[V]http://genshi.edgewall.org/wiki/Documentation/text-templates.html\f[R] for syntax.) if their file extension starts with \f[V]t\f[R], .IP \[bu] 2 Copied to the web album destination otherwise. .PP Using the theme manifest \f[V]theme/manifest.json\f[R] file, it is possible to include files from other directories to be copied into the web album shared files. .IP .nf \f[C] { \[dq]shared\[dq]: [ # copy as shared/lib.js { \[dq]path\[dq]: \[dq]../lib-2.1.js\[dq], \[dq]dest\[dq]: \[dq]lib.js\[dq] }, # copy as shared/js/lib-2.1.js { \[dq]path\[dq]: \[dq]../lib-2.1.js\[dq], \[dq]dest\[dq]: \[dq]js/\[dq] } # copy first found as shared/lib.js # instruct ./setup.py dl_assets to download it from url otherwise { \[dq]path\[dq]: [ \[dq]/usr/share/javascript/lib-2.1.js\[dq], \[dq]lib.js\[dq]], \[dq]dest\[dq]: \[dq]lib.js\[dq], \[dq]url\[dq]: \[dq]https://lib.com/lib-latest.js\[dq] }, # copy prefixed files in shared/ { \[dq]path\[dq]: \[dq]SHARED_*\[dq] }, ] } \f[R] .fi .PP Please refer to the examples supplied in \f[V]/usr/share/lazygal/themes\f[R]. .SH ALBUM METADATA .PP If a directory from the source album contains a file named \f[V]album_description\f[R], it is processed as a source of album metadata. The format is borrowed from another album generating tool - Matew. Each line is treated as one possible tag, unknown lines are simply ignored. Example content of this file follows: .IP .nf \f[C] Album name \[dq]My album\[dq] Album description \[dq]Description, which can be very long.\[dq] Album image identifier relative/path/to/image.jpg \f[R] .fi .PP Otherwise, the user can provide metadata in the following files. .TP \f[V]SOURCE_DIR/album-name\f[R] The title to use for this album directory. .TP \f[V]SOURCE_DIR/album-description\f[R] The description for this album directory. HTML tags are used verbatim from this file. .TP \f[V]SOURCE_DIR/album-picture\f[R] The relative path to the image to use at the top of the album picture stack. .TP \f[V]SOURCE_DIR/PICTURE_FILENAME.comment\f[R] The description to use for this particular image. Please note that HTML tags are taken as provided in this file for output in the templates. .PP Lazygal also extracts information from many metadata tags in image files. Regarding image description, Lazygal searches for comments in this order: .IP "1." 3 \f[V]pic.jpeg.comment\f[R] file .IP "2." 3 \f[V]Exif.Photo.UserComment\f[R] .IP "3." 3 \f[V]Exif.Image.ImageDescription\f[R] .IP "4." 3 \f[V]Iptc.Application2.ObjectName\f[R] .IP "5." 3 JPEG comment .SH FILES .TP \f[V]\[ti]/.lazygal\f[R] User configuration directory. .TP \f[V]\[ti]/.lazygal/themes\f[R] User themes directory. .SH CONFIGURATION FILES .PP Multiple configuration files are processed by DHPACKAGE. The configuration is initially set up with the defaults. The defaults can be found in the DHPACKAGE source distribution in \f[V]lazygal/defaults.json\f[R]. .PP Then, the configuration files are processed in the following order, each newly defined value overloading formerly defined values. .PP Finally, any command-line-provided parameter takes precedence on any configuration file value. .TP \f[V]\[ti]/.lazygal/config\f[R] User configuration file. See LAZYGAL-CONF for format. .TP \f[V]SOURCE_DIR/.lazygal\f[R] Album root configuration file. See LAZYGAL-CONF for format. .TP \f[V]SOURCE_DIR/gal/.lazygal\f[R] Web gallery configuration file. Only the \f[V]webgal\f[R] and \f[V]template-vars\f[R] sections are red in these files. The configuration applies to the gallery representing the directory of the configuration file, and all of its sub-directories, unless another configuration file in a sub-directory overloads some of the defined configuration values. See LAZYGAL-CONF for format. .SH SIZE DESCRIPTION .PP The size string follows the same syntax as ImageMagick\[aq]s. .TP \f[V]scale\f[R]% Height and width both scaled by specified percentage. .TP \f[V]xscale\f[R]%\f[V]yscale\f[R]% Height and width individually scaled by specified percentages. .TP width Width given, height automatically selected to preserve aspect ratio. .TP x\f[V]height\f[R] Height given, width automatically selected to preserve aspect ratio. .TP \f[V]width\f[R]x\f[V]height\f[R] Maximum values of height and width given, aspect ratio preserved. .TP \f[V]width\f[R]x\f[V]height\f[R]\[ha] Minimum values of width and height given, aspect ratio preserved. .TP \f[V]width\f[R]x\f[V]height\f[R]! Width and height emphatically given, original aspect ratio ignored. .TP \f[V]width\f[R]x\f[V]height\f[R]> Change as per the supplied dimensions but only if an image dimension exceeds a specified dimension. .TP \f[V]width\f[R]x\f[V]height\f[R]< Change dimensions only if both image dimensions exceed specified dimensions. .TP \f[V]pixels\f[R]\[at] Resize image to have specified area in pixels. Aspect ratio is preserved. .SH TAG FILTERING .PP Tag filtering supports regular expression matching thanks to the \[aq]re\[aq] module of Python. All the filter matchings can be indicated to lazygal by successive uses of the \[aq]filter-by-tag\[aq] option, or by giving a coma-separated list of keywords. .PP We illustrate here how more elaorated tag filtering can be done. .PP We want to export only the images that have the tags \[aq]lazygal\[aq] AND \[aq]hiking\[aq]. .PP \f[V]$ lazygal --filter-by-tag=lazygal --filter-by-tag=hiking\f[R] .PP or: .PP \f[V]$ lazygal --filter-by-tag=lazygal,hiking\f[R] .PP We want to export the images that have the tags \[aq]lazygal\[aq] OR \[aq]hiking\[aq]. .PP \f[V]$ lazygal --filter-by-tag=\[dq](lazygal|hiking)\[dq]\f[R] .PP We want to export the images that have one of the tags \[aq]hiking_2012\[aq], \[aq]hiking_2013\[aq], \[aq]hiking_France\[aq], etc. .PP \f[V]$ lazygal --filter-by-tag=\[dq]hiking_.*\[dq]\f[R] .PP We want to export the images that have the tag \[aq]lazygal\[aq], AND one of the tags \[aq]hiking_2012\[aq], \[aq]hiking_2013\[aq], \[aq]hiking_France\[aq], etc. .PP \f[V]$ lazygal --filter-by-tag=\[dq]lazygal,hiking_.*\[dq]\f[R] .SH SEE ALSO .PP \f[B]lazygal.conf\f[R](5) .PP More information is available on the program website: \f[V]https://sml.zincube.net/\[ti]niol/repositories.git/lazygal/about/\f[R]. .SH AUTHOR .PP This manual page was written for the DEBIAN system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. .PP On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. .SH AUTHORS Alexandre Rossi.