Barblery, a Python image gallery generator
This is my very first program in Python, dated 2005, consequently it is a piece of buggy and inefficient code. Recently I decided to reuse it because I need a simple way to manage remotely the pictures stored in my NAS.
Following is the original presentation.
During my outdoor activities I often take pictures using my digital camera.
Soon I got a huge amount of pictures, and I was looking for a simple gallery generator, in order easily browse the photo album.
I started using the tool included into konqueror file browser, I found it very nice, but it was not exactly what I was looking for. , second I wanted to have a description automatically generated by a simple text file. That was a good occasion to learn some Python coding.
Barblery scans recursively for images, starting from a given directory.
For each directory it creates a file images.html containing a thumbnail gallry of the pictures found.
It can also draw some nice navigation button to move around the directory tree and, if file exists, it prints at the beginning of the page the content of a description file, named description.txt
It has been totally written using the Python language, thus for properly working a Python interpreter (version 2.3 or greater) must be installed on your PC.
In order to obtain thumbnails the convert utility, provided by imagemagick tool must be installed. Imagemagick is provided in many GNU/Linux distribution (Debian users: apt-get install imagemagick). Alternatively you can use any other thumbnail generator provided that it is called "convert" and it accept the same syntax.
- It scans recursively into subdirectories, one command build all
- If a description.txt file is found into directory, it is converted into html and inserted at the begin of the generated HTML page
- Uses HTML template file and CSS, that can be easily customized for user needings
- Download the file
- untar the file
- cd barblery
- at prompt type ./configure, it will create a directory named .barblery_data containing configuration files, CSS and HTML template
CD to the barblery directory and type:
barblery [options] input_dir
Available options:
| Short | Long | Description |
|---|---|---|
| -h | --help | show this help message and exit |
| -v | --verbose | verbose mode ON [default] |
| -q | --quiet | run silent |
| -d DATA_DIR | --data-dir=DATA_DIR | data directory [HOME/.barblery_data] |
| -t TITLE | --title=TITLE | set HTML title to TITLE |
| -s | --show-buttons | show navigation buttons on page |
| -r BTN_ROOT_URL | --root_url=BTN_ROOT_URL | root button URL [root_directory] |
| -b BTN_BACK_URL | --back_url=BTN_BACK_URL | back button URL [root_directory] |
| -n IMG_PER_ROW | --image-per-row=IMG_PER_ROW | put n images in a row [5] |
| -i | --image-caption | show image filename as caption |
| --rebuild_css | overwrite CSS file if found
-c CSS_FILENAME | --css_file=CSS_FILENAME | use different stylesheet -g GEOMETRY | --geometry=GEOMETRY | dimension of thumbnails [120x120]
Barblery is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. see COPYING file provided into the tarball for further details or visit the Free Software Foundation site. If you like this program you can consider to make me a donation by clicking on link below:
https://www.paypal.me/andreagangemi
Choise is always better. Probably you will find interesting and better this programs
- igal is a similar program written in Perl, it is available in many GNU/Linux distributions; the program home page is http://www.stanford.edu/~epop/igal
- Konqueror, the KDE file browser, has an automatic gallery generator
- Jalbum is a Java-based web album generator, free and highly customizable, home page is http://jalbum.net
Credits Thanks to:
- The Python language, finally a powerfull and easy Object Oriented language
- My friend D.M. (he wants to remain anonymous) who wrotes the very first lines of Barblery unveiling me some of the great features of Python language. The name Barblery was also suggested by him, it's a merge beetwen words Barba (beard, a nickname I have at work) and Gallery