Sigal Release 1.0.0

September 07, 2015

Contents

1 Themes & Demo 3

2 Documentation 5 2.1 Installation...... 5 2.2 Getting started...... 6 2.3 Configuration...... 7 2.4 Album information...... 11 2.5 Image information...... 11 2.6 Themes...... 12 2.7 Plugins...... 14 2.8 Contributing guidelines...... 18 2.9 Changelog...... 19

Python Module Index 25

i ii Sigal, Release 1.0.0

Sigal is yet another simple static gallery generator. It’s written in Python and it allows to build a static gallery of images with the following features: • Process directories recursively. • Generate HTML pages using jinja2 templates. • Relative links for a portable output. • Support themes, videos, tags, zip download. • Parallel processing. • MIT licensed. The idea behind Sigal is to ease the use of the javascript libraries like galleria. These libraries do a great job to display the images, Sigal does what is missing: resize images, create thumbnails, generate HTML pages. Sigal is compatible with Python 2.7 and 3.3+. Links : • Latest documentation on the website • Source, issues and pull requests on GitHub • Releases on PyPI • #sigal on Freenode, or with the webchat interface. • Mailing list at Librelist (Archives).

Contents 1 Sigal, Release 1.0.0

2 Contents CHAPTER 1

Themes & Demo

Sigal comes with three themes, based on the colorbox, galleria and photoswipe Javascript libraries: • colorbox demo • galleria demo • photoswipe demo

3 Sigal, Release 1.0.0

4 Chapter 1. Themes & Demo CHAPTER 2

Documentation

2.1 Installation

Install the extension with one of the following commands: $ easy_install sigal

or alternatively if you have pip installed: $ pip install sigal

2.1.1 Dependencies

• Click • Jinja2 • Pilkit • Python Imaging Library (PIL / Pillow, see below) • Python Markdown

2.1.2 PIL or Pillow ?

PIL is almost dead, the last release was in 2009. If possible you should prefer to use Pillow, a fork of PIL which is actively developped, with packaging improvements, Python 3 compatibility, etc. You can install Pillow with pip install Pillow, preferably in a virtualenv. To have JPG and PNG support, you must first install the developpement packages of libjpeg, freetype2 and zlib. • For /, this is possible with: apt-get build-dep python-dev python-imaging

Debian/Sid users can use the experimental python-imaging package that is built from Pillow source. • For Archlinux, there is a package for sigal in the AUR which already uses Pillow.

5 Sigal, Release 1.0.0

2.2 Getting started

2.2.1 How to Use

Initialize To get started, just run sigal init which will copy an example configuration file in the current directory. All configuration values have a default; values that are commented out serve to show the default. Default values are specified when modified in this example config file. Build After adapting the configuration to your needs, put your images in a sub-directory and run sigal build . The next time you run sigal build, only the new images will be processed. You can use the -f flag to force the reprocessing of all the images. Images (resp. videos) that are smaller than the size specified by the img_size (resp. video_size) setting will not be resized. You may also want to know how to specify information about albums and images. Serve To visualize your gallery, you can use sigal serve which runs a basic web server. This server should only be used for local browsing, not in production. Another option is to use the index_in_url = True setting, which will add index.html to the urls to allow browsing without a server.

2.2.2 Help on the sigal build command

$ sigal build [-h] [-d] [-v] [-f] [-c CONFIG] [-t THEME] [-n NCPU] [source] [destination]

Required arguments: source Input directory destination Output directory (default: _build/) Optional arguments: -h, --help Show this help message and exit -f, --force Force the reprocessing of existing images and thumbnails -v, --verbose Show all messages -d, --debug Show all message, including debug messages -c CONFIG, --config CONFIG Configuration file (default: sigal.conf.py in the current working direc- tory) -t THEME, --theme THEME Specify a theme directory, or a theme name for the themes included with Sigal -n NCPU, --ncpu NCPU Number of cpu to use (default: all)

2.2.3 Help on the sigal serve command

$ sigal serve [-c CONFIG] [-p PORT] [destination]

Optional arguments: -c CONFIG, --config CONFIG Configuration file (default: sigal.conf.py in the current working direc- tory)

6 Chapter 2. Documentation Sigal, Release 1.0.0

-p PORT, --port PORT Port number to start the server on (default: 8000) destination Destination directory where the output of build is located (default: _build)

2.3 Configuration

The configuration must be set in a sigal.conf.py file in the current directory. It can also be specified with the -c flag. An example file with explanations on the settings is available in sigal/templates/sigal.conf.py and is shown below. This file is copied to the current directory with the sigal init commmand.

#-*- coding: utf-8 -*- # # All configuration values have a default; values that are commented out serve # to show the default. Default values are specified when modified in this # example config file

# Gallery title. Can be set here or as the '--title' option of the `sigal # build` command, or in the 'index.md' file of the source directory. # The priority order is: cli option > settings file > index.md file # title = "Sigal test gallery"

# ------# General configuration # ------

# Source directory. Can be set here or as the first argument of the `sigal # build` command source='pictures'

# Destination directory. Can be set here or as the second argument of the # `sigal build` command (default: '_build') # destination = '_build'

# Theme : # - colorbox (default), galleria, photoswipe, or the path to a custom theme directory theme='galleria'

# Author. Used in the footer of the pages and in the author meta tag. # author = ''

# Use originals in gallery (default: False). If True, this will bypass all # processing steps (resize, auto-orient, recompress, and any plugin-specific # step). # Originals will be symlinked if orig_link = True, else they will be copied. # use_orig = False

# ------# Image processing (ignored if use_orig = True) # ------

# Size of resized image (default: (640, 480)) img_size=(800, 600)

# Should we use openlayers to show a map of the images where possible? # This option only has an effect on the galleria theme for the while. # show_map = False

2.3. Configuration 7 Sigal, Release 1.0.0

# Pilkit processor used to resize the image # (see http://pilkit.readthedocs.org/en/latest/#processors) # - ResizeToFit: fit the image within the specified dimensions (default) # - ResizeToFill: crop THE IMAGE it to the exact specified width and height # - SmartResize: identical to ResizeToFill, but uses entropy to crop the image # - None: don't resize # img_processor = 'ResizeToFit'

# Autorotate images # Warning: this setting is not compatible with `copy_exif_data` (see below), # because Sigal can't save the modified Orientation tag (currently Pillow can't # write EXIF). # autorotate_images = True

# If True, EXIF data from the original image is copied to the resized image # copy_exif_data = False

# Jpeg options # jpg_options = {'quality': 85, # 'optimize': True, # 'progressive': True}

# ------# Thumbnail generation # ------

# Generate thumbnails # make_thumbs = True

# Subdirectory of the thumbnails # thumb_dir = 'thumbnails'

# Prefix and/or suffix for thumbnail filenames (default: '') # thumb_prefix = '' # thumb_suffix = '.tn'

# Thumbnail size (default: (200, 150)) # For the galleria theme, use 280 px for the width # For the colorbox and photoswipe theme, use 200 px for the width thumb_size=(280, 210)

# Crop the image to fill the box # thumb_fit = True

# Delay in seconds to avoid black thumbnails in videos with fade-in # thumb_video_delay = '0'

# Keep original image (default: False) # keep_orig = True

# Subdirectory for original images # orig_dir = 'original'

# Use symbolic links instead of copying the original images # orig_link = False

# Reverse sort for albums # albums_sort_reverse = False

8 Chapter 2. Documentation Sigal, Release 1.0.0

# Attribute of Media objects which is used to sort medias. 'date' can be used # to sort with EXIF dates. # medias_sort_attr = 'filename'

# Reverse sort for medias # medias_sort_reverse = False

# Filter directories and files. # The settings take a list of patterns matched with the fnmatch module on the # path relative to the source directory: # http://docs.python.org/2/library/fnmatch.html ignore_directories=[] ignore_files=[]

# ------# Video options # ------

# Video format # specify an alternative format, valid are 'webm' (default) and 'mp4' # video_format = 'webm'

# Webm options # Options used in ffmpeg to encode the webm video. You may want to read # http://ffmpeg.org/trac/ffmpeg/wiki/vpxEncodingGuide # Be aware of the fact these options need to be passed as strings. If you are # using avconv (for example with Ubuntu), you will need to adapt the settings. # webm_options = ['-crf', '10', '-b:v', '1.6M', # '-qmin', '4', '-qmax', '63']

# MP4 options # Options used to encode the mp4 video. You may want to read # https://trac.ffmpeg.org/wiki/Encode/H.264 # mp4_options = ['-crf', '23' ]

# Size of resized video (default: (480, 360)) # video_size = (480, 360)

# ------# Miscellaneous # ------

# Write HTML files. If False, sigal will only process the images. # write_html = True

# Name of the generated HTML files # output_filename = 'index.html'

# Add output filename (see above) to the URLs # index_in_url = False

# Use CDN for assets (Google fonts, JQuery). # If False some fonts may not be available. # use_assets_cdn = True

# A list of links (tuples (title, URL)) # links = [('Example link', 'http://example.org'), # ('Another link', 'http://example.org')]

2.3. Configuration 9 Sigal, Release 1.0.0

# Google Analytics tracking code (UA-xxxx-x) # google_analytics = ''

# Piwik tracking # tracker_url must not contain trailing slash. # Example : {'tracker_url': 'http://stats.domain.com', 'site_id' : 2} # piwik = {'tracker_url': '', 'site_id' : 0}

# Set zip_gallery to either False or a file name. The final archive will # contain all resized or original files (depending on `zip_media_format`). # zip_gallery = False # False or 'archive.zip' # zip_media_format = 'resized' # 'resized' or 'orig'

# Specify a different locale. If set to '', the default locale is used. # locale = ''

# List of files to copy from the source directory to the destination. # A symbolic link is used if ``orig_link`` is set to True (see above). # files_to_copy = (('extra/robots.txt', 'robots.txt'), # ('extra/favicon.ico', 'favicon.ico'),)

# Colorbox theme config # The column size is given in number of column of the css grid of the Skeleton # framework which is used for this theme: http://www.getskeleton.com/#grid # Then the image size must be adapted to fit the column size. # The default is 4 columns which gives 220px. 3 columns gives 160px. # colorbox_column_size = 4

# ------# Plugins # ------

# List of plugins to use. The values must be a path than can be imported. # Another option is to import the plugin and put the module in the list, but # this will break with the multiprocessing feature (the settings dict obtained # from this file must be serializable). # plugins = ['sigal.plugins.adjust', 'sigal.plugins.copyright', # 'sigal.plugins.upload_s3', 'sigal.plugins.media_page']

# Add a copyright text on the image (default: '') # copyright = "© An example copyright message"

# Adjust the image after resizing it. A default value of 1.0 leaves the images # untouched. # adjust_options = {'color': 1.0, # 'brightness': 1.0, # 'contrast': 1.0, # 'sharpness': 1.0}

# Settings for upload to s3 plugin # upload_s3_options = { # 'bucket': 'my-bucket', # 'policy': 'public-read', # 'overwrite': False #}

10 Chapter 2. Documentation Sigal, Release 1.0.0

2.4 Album information

Information on an album can be given in a file using the markdown syntax, named index.md : Title: Another example gallery Thumbnail: test2.jpg Author: John Doe

And a description with *Markdown* syntax.

Some meta-data keys are used by Sigal to get the useful informations on the gallery: • Title: the gallery title. • Thumbnail: the thumbnail that will be used in the parent directory to represent the gallery. • Author: the author of the gallery, if present it is used instead of the author setting. Any additional meta-data is available in the templates. For instance: Authors: Waylan Limberg John Doe

can be used in the template with: {% if 'authors' in meta %}

Authors: {{ meta.authors|join(', ') }} {% endif %}

If this file does not exist or if some meta-data is missing: • The directory’s name is used for the title. • The first landscape image of the directory is used as thumbnail, or the first image if no landscape image is found.

2.5 Image information

Additional information on an image can be given in a file using the markdown syntax, named .md (example: IMG_5206.md): Title: My awesome photo

And a description with *Markdown* syntax.

EXIF data is directly extracted, see Simpler EXIF data output. Some meta-data keys are used by Sigal to get the useful informations on the gallery: • Title: the image title. Any additional meta-data is available in the templates. For instance: Location: Las Vegas

can be used in the template with: {% if media.meta.location %}

Location: {{ media.meta.location[0] }} {% endif %}

2.4. Album information 11 Sigal, Release 1.0.0

2.6 Themes

Gallery pages are created from a Jinja2 template index.html that must be located in THEME_DIR/templates.

2.6.1 Bundled themes

Sigal comes with three themes, located in the sigal/themes folder: colorbox: source, demo. This theme uses a Swipe plugin to browse pictures on touch devices. galleria: source, demo. This theme is based on the classic theme, pictures can be browsed with left/right keys, fullscreen support is available with the f key, and a map can be shown with the m key if the show_map setting is True. photoswipe: source, demo. The photoswipe theme comes with some limitations : It does not support video (see https://github.com/dimsemenov/PhotoSwipe/issues/651 for details). Video support will be added when avail- able. For developers, a Makefile is available to concatenate and minify the css files, using cssmin( pip install cssmin).

2.6.2 Variables

You can use the following variables in your template: album The current album that is rendered in the HTML file, represented by an Album object. album.medias contains the list of all medias in the album (represented by the Image and Video objects, inherited from Media). index_title Name of the index. This is either the directory name or the title specified in the index.md of the source directory. settings The entire dictionary from sigal.conf.py. sigal_link URL to the Sigal homepage. theme.name, theme.url Name and url of the currently used theme.

Documentation of sigal’s main classes class sigal.gallery.Album(path, settings, dirnames, filenames, gallery) Gather all informations on an album. Attributes: Variables • description_file – Name of the Markdown file which gives information on an album • index_url – URL to the index page. • output_file – Name of the output HTML file • meta – Meta data from the Markdown file. • description – description from the Markdown file. For details how to annotate your albums with meta data, see Album information.

12 Chapter 2. Documentation Sigal, Release 1.0.0

albums List of Album objects for each sub-directory. breadcrumb List of (url, title) tuples defining the current breadcrumb path. create_output_directories() Create output directories for thumbnails and original images. description_file = ‘index.md’ images List of images (Image). show_map Check if we have at least one photo with GPS location in the album sort_medias(medias_sort_attr) thumbnail Path to the thumbnail of the album. url URL of the album, relative to its parent. videos List of videos (Video). zip Make a ZIP archive with all media files and return its path. If the zip_gallery setting is set,it contains the location of a zip archive with all original images of the corresponding directory. class sigal.gallery.Media(filename, path, settings) Base Class for media files. Attributes: •type: "image" or "video". •filename: Filename of the resized image. •thumbnail: Location of the corresponding thumbnail image. •big: If not None, location of the unmodified image. •exif: If not None contains a dict with the most common tags. For more information, see Simpler EXIF data output. •raw_exif: If not None, it contains the raw EXIF tags. big Path to the original image, if keep_orig is set (relative to the album directory). Copy the file if needed. extensions = () thumbnail Path to the thumbnail image (relative to the album directory). type = ‘’ class sigal.gallery.Image(filename, path, settings) Gather all informations on an image file. date

2.6. Themes 13 Sigal, Release 1.0.0

exif extensions = (‘.jpg’, ‘.’, ‘.png’) has_location() raw_exif size thumb_size type = ‘image’ class sigal.gallery.Video(filename, path, settings) Gather all informations on a video file. extensions = (‘.mov’, ‘.avi’, ‘.mp4’, ‘.webm’, ‘.ogv’) type = ‘video’

2.6.3 Simpler EXIF data output

Because the tags in the media.raw_exif dictionary are a little bit cumbersome to use, some common tags are extracted and formatted for easy use in templates. If available, you can use: media.exif.iso The ISO speed rating. media.exif.focal The focal length, formatted as a decimal number. media.exif.exposure The exposure time formatted as a fractional number, e.g. “1/500”. media.exif.fstop The aperture value given as an F-number and formatted as a decimal. media.exif.datetime The time the image was taken. It is a datetime object, that can be formatted with strftime: {% if media.exif.datetime %} {{ media.exif.datetime.strftime('%A, %d. %B %Y') }} {% endif %}

This will output something like “Monday, 25. June 2013”, depending on your locale. media.exif.gps If not None, the dict contains two keys lat and lon denoting the GPS coordinates of the location where the image was taken. lat will always be referenced to the north pole whereas lon will be referenced to east to the prime meridan. To provide a link on an OpenStreetMap you could write a template like this: {% if media.exif.gps %} Go to location {% endif %}

2.7 Plugins

2.7.1 How to use plugins

Plugins must be specified with the plugins setting:

14 Chapter 2. Documentation Sigal, Release 1.0.0

plugins=['sigal.plugins.adjust','sigal.plugins.copyright']

You can either specify the name of the module which contains the plugin, or import the plugin before adding it to the list: from sigal.plugins import copyright plugins=['sigal.plugins.adjust', copyright]

Note: Using an import like this will break the multiprocessing feature, because the settings dict must be serializable. So in most cases you should prefer the first option.

The plugin_paths setting can be used to specify paths to search for plugins (if they are not in the python path).

2.7.2 Write a new plugin

Plugins are based on signals with the blinker library. A plugin must subscribe to a signal (the list is given below). New signals can be added if need. See an example with the copyright plugin:

#-*- coding: utf-8 -*-

"""Plugin which add a copyright to the image.

Settings:

- ``copyright``: the copyright text. - ``copyright_text_font``: the copyright text font - either system/user font-name or absolute path to font.tff file. If no font is specified, or specified font is not found, default font is used. - ``copyright_text_font_size``: the copyright text font-size. If no font is specified, this setting is ignored. - ``copyright_text_color``: the copyright text color in 3 tuple (R, G, B) Decimal RGB code. e.g. (255, 255, 255) is White. - ``copyright_text_position``: the copyright text position in 2 tuple (left, top). By default text would be positioned at bottom-left corner.

""" import logging from PIL import ImageDraw from PIL import ImageFont from sigal import signals logger= logging.getLogger(__name__) def add_copyright(img, settings=None): logger.debug('Adding copyright to %r', img) draw= ImageDraw.Draw(img) text= settings['copyright'] font= settings.get('copyright_text_font', None) font_size= settings.get('copyright_text_font_size', 10) assert font_size>=0 color= settings.get('copyright_text_color',(0,0,0)) bottom_margin=3 # bottom margin for text text_height= bottom_margin+ 12 # default text height (of 15) for default font if font: try: font= ImageFont.truetype(font, font_size)

2.7. Plugins 15 Sigal, Release 1.0.0

text_height= font.getsize(text)[1]+ bottom_margin except: # load default font in case of any exception logger.debug("Exception: Couldn't locate font %s, using default font", font) font= ImageFont.load_default() else: font= ImageFont.load_default() left, top= settings.get('copyright_text_position',(5, img.size[1]- text_height)) draw.text((left, top), text, fill=color, font=font) return img

def register(settings): if settings.get('copyright'): signals.img_resized.connect(add_copyright) else: logger.warning('Copyright text is not set')

2.7.3 Signals

sigal.signals.album_initialized(album) Called after the Album is initialized. Parameters album – the Album object. sigal.signals.gallery_initialized(gallery) Called after the gallery is initialized. Parameters gallery – the Gallery object. sigal.signals.media_initialized(media) Called after the Media (Image or Video) is initialized. Parameters media – the media object. sigal.signals.gallery_build(gallery) Called after the gallery is build (after media are resized and html files are written). Parameters gallery – the Gallery object. sigal.signals.img_resized(img, settings=settings) Called after the image is resized. This signal work differently, the modified image object must be returned by the registered funtion. Parameters • img – the PIL image object. • settings – the settings dict.

2.7.4 List of plugins

Adjust plugin

Plugin which adjust the image after resizing. Based on pilkit’s Adjust processor. Settings:

16 Chapter 2. Documentation Sigal, Release 1.0.0

adjust_options={'color': 1.0, 'brightness': 1.0, 'contrast': 1.0, 'sharpness': 1.0}

Copyright plugin

Plugin which add a copyright to the image. Settings: • copyright: the copyright text. • copyright_text_font: the copyright text font - either system/user font-name or absolute path to font.tff file. If no font is specified, or specified font is not found, default font is used. • copyright_text_font_size: the copyright text font-size. If no font is specified, this setting is ignored. • copyright_text_color: the copyright text color in 3 tuple (R, G, B) Decimal RGB code. e.g. (255, 255, 255) is White. • copyright_text_position: the copyright text position in 2 tuple (left, top). By default text would be positioned at bottom-left corner.

Media page plugin

Plugin which generates HTML pages for each image. Currently this plugin can be used only with the colorbox theme, the other themes have to be adapted. For themes, the previous_media and next_media variables contain the previous/next Media objects.

Upload to S3 plugin

Plugin to upload generated files to Amazon S3. This plugin requires boto. All generated files are uploaded to a specified S3 bucket. When using this plugin you have to make sure that the bucket already exists and the you have access to the S3 bucket. The access credentials are managed by boto and can be given as environment variables, configuration files etc. More information can be found on the boto documentation. Settings (all settings are wrapped in upload_s3_options dict): • bucket: The to-be-used bucket for uploading. • policy: Specifying access control to the uploaded files. Possible values: private, public-read, public-read- write, authenticated-read • overwrite: Boolean indicating if all files should be uploaded and overwritten or if already uploaded files should be skipped. • max_age: Optional, Integer indicating the number of seconds that the cache control should be set by de- fault • media_max_age: Optional, Integer indicates the number of seconds that cache control hould be set for media files

2.7. Plugins 17 Sigal, Release 1.0.0

Watermark plugin

Plugin which adds a watermark to the image. Settings: • watermark: path to the watermark image. • watermark_position: the watermark position either ‘scale’ or ‘tile’ or a 2-tuple giving the upper left corner, or a 4-tuple defining the left, upper, right, and lower pixel coordinate, or None (same as (0, 0)). If a 4-tuple is given, the size of the pasted image must match the size of the region. • watermark_opacity: the watermark opacity (0.0 to 1.0).

2.8 Contributing guidelines

2.8.1 Filing issues

If you have an issue with sigal, the first step is to run: sigal build -fd -n 1

to get diagnostic information (debug mode, only one core). If you can identify an image or video that is causing the issue, you can create a new directory containing only this image/video and rerun sigal build -fd -n 1. Then, put the output into a gist/pastebin, and fill an issue on github. You can also write to the mailing list or try to get help via the #sigal IRC channel on freenode.

2.8.2 How To Contribute sigal is always open for suggestions and contributions by generous developers. Here are a few tips to get you started. Please: • Obey PEP 8 and PEP 257. • Always add tests and docs for your code. • Add yourself to the AUTHORS file in an alphabetical fashion, and add your name to the license header of the files you modify. • Write good commit messages. • Ideally, squash your commits, i.e. make your pull requests just one commit. • Use a branch, it will be easier to squash or rebase on upstream’s master. Thank you for considering to contribute to sigal !

2.8.3 Setting up the development environment

Using a virtualenv: git clone https://github.com/saimn/sigal.git cd sigal virtualenv venv . venv/bin/activate

18 Chapter 2. Documentation Sigal, Release 1.0.0

Install sigal in development mode: pip install -e .

Install additional dependencies for development (Sphinx, ...): pip install -r requirements.txt

2.8.4 Building the docs

• Run make docs (or make html in the docs/ directory).

2.8.5 Running the test suite

• Run make test (or py.test). • Run make coverage to get the coverage report. • Using tox you can also run the tests on multiple versions of python.

2.9 Changelog

2.9.1 Version 1.0.0

Released on 2015-09-07. • Colorbox: Use the media title if available (fix #145). • Adds a thumb_video_delay parameter for the creation of thumbnails with fade-in videos [#143]. • Add fullscreen display support to Galleria theme [#149]. • Add watermark plugin [#148]. • Allow more settings for font, color, position in the copyright plugin [#150]. • Tables support in markdown [#155]. • Honor ‘use_orig’ for videos [#153]. • Fix for the relative path checks for Windows [#160]. • Add support for mp4 [#159]. • Add size property into Image object [#164]. • Make sure that bad exif data does not crash sigal. • Strip spaces for some exif tags (fix #154). • Add support for piwik [#165]. • Add a theme using photoswipe [#163]. • Add a setting to disable google fonts and jquery [#168]. • Add swipe to colorbox theme [#116]. • Map view for albums in galleria theme [#45].

2.9. Changelog 19 Sigal, Release 1.0.0

2.9.2 Version 0.9.2

Released on 2015-01-25. • Allow to specify the author of an album (ref #139). • Fix encoding issue with the progress bar on py3 (fix #137). • Avoid failure when an image can’t be read (fix #134).

2.9.3 Version 0.9.1

Released on 2014-12-08. • Fix images path for the galleria theme (fix #130).

2.9.4 Version 0.9.0

Released on 2014-12-07. • New plugin which adds the ability to generate media pages [#126]. • Decrease logs level for the parsing of exif tags [#127]. • Enhance documentation for album information [#123]. • Fix the title which was not unicode when using the settings file [#104]. • Add more info on how the report a bug or contribute [#128]. • Add more commands to the Makefile. • Add coveralls.io • New plugin to upload generated gallery to Amazon S3 [#114]. • Handling of empty markdown or missing meta-data [#120]. • Include plugins in the distributed package [#117]. • Allow to use directly original files [#118]. • Add settings to give a different output filename than index.html [#115]. • Remove files that can’t be processed for some reason [#112]. • Skip files that don’t exist in the ZIP archiving [#110]. • Show progress (spinners & bars), read exif only on access [#109]. • Use the correct filename for original videos [#111]. • Check that the file exists before removing. [#110]. • Enhance the serve command [#107]. • Catch cPickle error and add a message about serialization error with the settings file.

2.9.5 Version 0.8.1

Released on 2014-10-07. • Include plugins in the distributed package.

20 Chapter 2. Documentation Sigal, Release 1.0.0

2.9.6 Version 0.8.0

Released on 2014-08-30. • Add a setting and a cli option to specify the gallery title (title and --title) (ref #91). • Add a mailing list at Librelist (sigal at librelist.com). • Add an option to specify the port to use for the serve command. • Replace argh with click. • Don’t overwrite existing config file (with the init command). • Don’t fail if there are no pictures. • Use plain css to simplify theme customizing (no more sass). • Upgrade colorbox 1.5.13 • Upgrade galleria 1.4.2 • Use HTML5 output for Markdown. • Allow to read additional data for images from markdown files. • Use case insensitive check for file extensions (fix #99). • Add a plugin system with blinker, and make plugins for copyright and adjust. • Mention the irc channel on freenode and add travis notifications. • Avoid failure if GPS tags contain zero values (fix #96). • Remove output file when the ffmpeg process has been interrupted (ref #90). • Fix thumbnail urls to always use slashes (ref #81).

2.9.7 Version 0.7

Released on 2014-05-10. • Refactor the way to store album and media informations. Albums, images and videos are now represented by objects, and these objects are directly available in the templates. The following template variables have been renamed: – albums => album.albums – breadcrumb => album.breadcrumb – description => album.description – index_url => album.index_url – medias => album.medias – title => album.title – media.file => media.filename – media.thumb => media.thumbnail – zip_gallery => album.zip • New settings to define the sort order for albums and medias: albums_sort_reverse, medias_sort_attr, medias_sort_reverse [#2].

2.9. Changelog 21 Sigal, Release 1.0.0

• New setting (autorotate_images) to disable autorotation of images, and warn about the incompatibility between autorotation and EXIF copy [#72]. • New settings to filter directories and files with pattern matching (ignore_directories and ignore_files) [#63]. • New setting to customize the column width of the colorbox theme (colorbox_column_size). • New setting to choose the media format used for ZIP archives (zip_media_format). • Update galleria to 1.3.5 and add the history plugin [#93]. • Skip image instead of failing when the image is corrupted [#69]. • Better handling of album urls (quoting special caracters).

2.9.8 Version 0.6.0

Released on 2014-01-25. • Add support for Python 3.3. • Parallel processing (new command-line option -n|--ncpu, uses all cores by default). • Adding keyboard shortcuts for the galleria theme [#32, #39]. • Include symlinked directories in the source directory. • New setting to use symbolic links for original files (orig_link) [#36]. • New setting for the video size (video_size) [#35]. • Add a colored formatter for verbose and debug modes. • webm_options is now a list with ffmpeg options, to allow better flexibility and compatibility with avconv. • New setting to copy files from the source directory to the destination (files_to_copy). Bugfixes: • Avoid issues with corrupted exif data. • Fix exif data not read from .JPEG files [#58]. • Fix whitespace issues with video filenames [#54].

2.9.9 Version 0.5.1

Released on 2013-09-23. • Fix error in calculating the degrees from exif data.

2.9.10 Version 0.5.0

Released on 2013-09-06. • Add support for videos. Videos are encoded to webm (see the webm_options setting). • Check jinja2’s version for lstrip_blocks (only for Jinja 2.7+). • Add option to zip galleries. See the zip_gallery setting.

22 Chapter 2. Documentation Sigal, Release 1.0.0

• Add support for EXIF tags and GPS coordinates. EXIF tags are added to the media context (for themes). The copy_exif_data setting allow to choose if the exif data from the original image is copied to the resized image. • Correct themes design with long directory names. • Add the possibility to adjust images after resizing (with the Adjust processor from Pilkit). See the adjust_options setting. • Add the possibility to disable image resizing.

2.9.11 Version 0.4.1

Released on 2013-07-19. • Fix a bug with unicode paths and filenames. • Update colorbox to 1.4.26 • Add links to the original images.

2.9.12 Version 0.4.0

Released on 2013-06-12. • Add a setting to disable the writing of HTML files. • Use Pilkit. • Remove multiprocessing. • Add new settings for the source and destination directories. • All meta-data are available in the templates. • Galleria theme is now responsive • Add a setting to choose the pilkit processor used to resize the images.

2.9.13 Version 0.3.3

Released on 2013-03-20. • Catch exception when PIL fails to read the exif metadata.

2.9.14 Version 0.3.2

Released on 2013-03-14. • Bugfix for PNG files which don’t have exif metadata. • Move unit tests to py.test. • Fix images path in colorbox theme. • Group package meta in a module.

2.9. Changelog 23 Sigal, Release 1.0.0

2.9.15 Version 0.3.1

Released on 2013-03-11. • Fix the path of the sample config file (which was not included in the previous release).

2.9.16 Version 0.3

Released on 2013-03-04. • Fix packaging issues. • New setting index_in_url to optionally add index.html to the URLs. • New setting links to specify a list of links. • Use EXIF info to fix orientation. • Replace the jpg_quality setting with a dict of options. • Manage directories with only sub-directories and add some checks. • Change the command-line interface to use sub-commands: init, build and serve. • Parallel processing.

2.9.17 Version 0.2

Released on 2012-12-20. • Improve the bundled themes (update galleria, new colorbox theme). • Improve the CLI (new arguments, nicer output). • Change the licence to MIT. • Change the description file to a markdown syntax file. • Change the settings file to a python file, and add more settings.

2.9.18 Version 0.1

Released on 2012-05-13. First public release.

24 Chapter 2. Documentation Python Module Index

s sigal.plugins.adjust, 16 sigal.plugins.copyright, 17 sigal.plugins.media_page, 17 sigal.plugins.upload_s3, 17 sigal.plugins.watermark, 18

25 Sigal, Release 1.0.0

26 Python Module Index Index

A sigal.plugins.media_page (module), 17 Album (class in sigal.gallery), 12 sigal.plugins.upload_s3 (module), 17 albums (sigal.gallery.Album attribute), 12 sigal.plugins.watermark (module), 18 size (sigal.gallery.Image attribute), 14 B sort_medias() (sigal.gallery.Album method), 13 big (sigal.gallery.Media attribute), 13 T breadcrumb (sigal.gallery.Album attribute), 13 thumb_size (sigal.gallery.Image attribute), 14 C thumbnail (sigal.gallery.Album attribute), 13 thumbnail (sigal.gallery.Media attribute), 13 create_output_directories() (sigal.gallery.Album method), type (sigal.gallery.Image attribute), 14 13 type (sigal.gallery.Media attribute), 13 D type (sigal.gallery.Video attribute), 14 date (sigal.gallery.Image attribute), 13 U description_file (sigal.gallery.Album attribute), 13 url (sigal.gallery.Album attribute), 13 E V exif (sigal.gallery.Image attribute), 13 extensions (sigal.gallery.Image attribute), 14 Video (class in sigal.gallery), 14 extensions (sigal.gallery.Media attribute), 13 videos (sigal.gallery.Album attribute), 13 extensions (sigal.gallery.Video attribute), 14 Z H zip (sigal.gallery.Album attribute), 13 has_location() (sigal.gallery.Image method), 14 I Image (class in sigal.gallery), 13 images (sigal.gallery.Album attribute), 13 M Media (class in sigal.gallery), 13 R raw_exif (sigal.gallery.Image attribute), 14 S show_map (sigal.gallery.Album attribute), 13 sigal.plugins.adjust (module), 16 sigal.plugins.copyright (module), 17

27