]> mj.ucw.cz Git - gallery.git/blob - README
fd868dd70a3da8582009d9ea8dd01f37838a3824
[gallery.git] / README
1 ================================================================================
2
3                                UCW::Gallery v2.0
4
5                     (c) 2004--2015 Martin Mares <mj@ucw.cz>
6
7 ================================================================================
8
9 This is a simple photo gallery for my web pages, or rather a set of bricks
10 from which you can create one. It can be freely used and distributed according
11 to the terms of the GNU GPL v2 or newer.
12
13 Requirements
14 ~~~~~~~~~~~~
15 Perl with the following non-core modules:
16
17    o  UCW::CGI (see http://www.ucw.cz/libucw/)
18    o  Image::Magick
19    o  Image::Exif
20    o  Archive::Zip
21    o  Digest::SHA
22    o  common::sense
23
24 Files and directories
25 ~~~~~~~~~~~~~~~~~~~~~
26
27    o  gal -- a front-end script for maintenance of galleries. All other programs
28       are run as sub-commands of this script. Try "gal --help".
29
30    o  gallery.cf -- all programs expect that the current directory contains
31       a configuration file. In fact, the config file is a perl script, whose
32       sole purpose is to set up paths, construct a gallery object and set its
33       options.
34
35       A simple example looks as follows:
36
37                 use UCW::Gallery;
38
39                 my $gal = UCW::Gallery->new;
40                 $gal->set(Title => 'A Gallery', SubTitle => '(an example)');
41                 return $gal;
42
43    o  gallery.list -- a list of original photos together with per-photo parameters.
44       Usually created by "gal scan", then tweaked manually. See `FORMATS' for
45       description of file syntax.
46
47    o  gallery.cache -- used internally by "gal scan" to store cached image hashes.
48
49    o  Originals directory -- original images, from which the gallery is generated.
50
51    o  Photo directory -- keeps processed (usually down-scaled) versions of the original
52       images. These are the images shown to the user.
53
54    o  Cache directory -- keeps various cached data, like thumbnails of all photos.
55
56    o  gallery.cgi -- interfaces the gallery to your web server. E.g.:
57
58                 #!/usr/bin/perl
59
60                 use lib "../path/to/gallery/modules";
61                 use UCW::Gallery;
62                 use UCW::Gallery::Web::Plain;
63
64                 my $gal = UCW::Gallery->load_config();
65                 UCW::Gallery::Web::Plain->run($gal);
66
67 Workflow
68 ~~~~~~~~
69
70    o  vi gallery.cf
71
72    o  gal scan /path/to/originals -- this creates gallery.list, populates it with
73       descriptions of all photos and reads rotation from EXIF tags.
74
75    o  vi gallery.list -- edit image descriptions and other options.
76
77    o  gal gen -- generate photos from the originals (after this, the originals are no
78       longer needed).
79
80    o  gal cache -- generate cached data.
81
82    o  Later, the gallery can be updated:
83
84         - When you edit image descriptions, re-run "gal cache".
85         - When you edit image options (rotation etc.), re-run "gal gen".
86         - When you want to add new images, re-run "gal scan". Give it the new list
87           of images and it will try to re-use as much information from the previous
88           gallery.list as possible.
89         - When you modify existing images, run "gal scan --update".
90
91    o  See example/* for an example web front-end.
92
93 Various notes
94 ~~~~~~~~~~~~~
95
96    o  When you want to re-generate all galleries at once, you can use
97       "gal --all -p4 gen". This will run "gal gen" on all subdirectories
98       containing "gallery.cf", 4 of them in parallel.
99
100    o  See bin/gal-mj-* for various hacks I wrote for myself.