PyLeporello allows the easy creation of web-based photo albums (sometimes called
leporello). It's a currently still quite simple script written in
python that creates
- thumbnails
- medium-sized images
- html-pages
for the images of a directory.
The script generates an
index.html-file displaying the thumbnails of the images in the leporello. Clicking on one of them opens another html-page that displays a larger (medium-sized) version of that image. It's possible to provide hi-res versions that can be accessed by clicking one more link. This option is enabled by default, but it can be disabled (to save bandwith), too.
The html-pages are generated using
templates that are inlined in the script. Therefore only the script-file is needed.
I customize the layout of the index-file and the individual image-pages via CSS, though.
Example
There is an example-output generated by
PyLeporello accessible
here.
'Download'
PyLeporello can be accessed
here.
PyLeporello_PostProcess can be downloaded
there.
Usage
PyLeporello
Drop the script into the directory where the image-files (currenlty only jpg is supported) are stored. Invoke the script with
python PyLeporello.py -t "title of album"
Additional options are available. Use
python PyLeporello.py -h
to get help.
PyLeporello_PostProcess
Change the index.html that was generated by the main script PyLeporello so that it reflects the order in which the images should be displayed. You may add some describing text.
Run PyLeporello_PostProcess in the same directory where the html-files and the images are located. PyLeporello_PostProcess will extract the new order from index.html and reorder the slide-show. It will also take the describing text from index.html and place it in the html-files for the individual images.
Dependencies
Motivation
- Foster my python-skills
- Wanted something quick and simple.
- The script can be easily customized to fit your needs. Since the script is interpreted (with the python-interpreter), you'll have to have the sources anyhow.
- The generated html is XHTML strict. It uses quite semantic markup. The content is separated from the layout. I plan to enhance on this, though.
Versioning
1.0 @ 20050428
1.1 @ 20050627
- PyLeporello is more verbose when processing the images.
- PyLeporello_PostProcess rearranges the order of the images in the slide-show according to the order in the index-file. More.
1.2 @ 20050724
- Size of image will not be included in html.
- Failure when html-file to be changed does not exist removed - template is used then.
- maybe always use the template: do not alter existing file but simply overwrite it.
Todo
- Further separation from content and layout.
- Generate local CSS which reflects the options chosen by the user!?
Similar projects
These are more elaborate...
Questions from users
In case you encountered problems, feel free to ask here. You can contact me more privately
here.
- Where comes the name PyLeporello from? I guess "Py" stands for python and "Leporello" for Leporello, but which one?
- None of the alternatives @ wikipedia. A foldable photo album, much like alternative 1 @ wikipedia is called a leporello. One such thing is on display at tesa's site.
Maybe I will add some {{Javascript}} that makes the album more leporello-like.
Suggestions from users
You have a suggestion on how to improve the script? Please drop your idea here or
contact me directly.
- Why does PyLeporello create a HTML-page for each image? Wouldn't it be more efficient somehow to create the midsize-image-page static but loading the mid-size-image itself dynamically? Thus you'll have just one HTML-file and your mid-size-image-files. But I don't know how complicate that would be... If it isn't clear yet: My goal was to minimize the number of HMTL-files ;-)
- I understand. If I could run Python-scripts on my webserver, I'd do just that. I cannot, though. The size of the generated HTML-files is small. The only uglyness of the static approach IMO is that the directory containing the files is cluttered with html- and jpg- files.
I could put these into separate sub-directories, though.
It's not a disadvantage for the user, though. The data-volume is not reduced by a dynamic solution.