-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
305 lines (217 loc) · 10.6 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
NAME
Apache::Gallery - mod_perl handler to create an image gallery
SYNOPSIS
See the INSTALL file in the distribution for installation instructions.
DESCRIPTION
Apache::Gallery creates an thumbnail index of each directory and allows
viewing pictures in different resolutions. Pictures are resized on the
fly and cached. The gallery can be configured and customized in many
ways and a custom copyright image can be added to all the images without
modifying the original.
The gallery will also show videos and allow downloading of other files.
CONFIGURATION
In your httpd.conf you set the global options for the gallery. You can
also override each of the options in .htaccess files in your gallery
directories.
The options are set in the httpd.conf/.htaccess file using the syntax:
PerlSetVar OptionName 'value'
Example: PerlSetVar GalleryCacheDir '/var/cache/www/'
GalleryCacheDir
Directory where Apache::Gallery should create its cache with scaled
pictures. The default is /var/cache/www/ . Here, a directory for
each virtualhost or location will be created automatically. Make
sure your webserver has write access to the CacheDir.
GalleryTemplateDir
Full path to the directory where you placed the templates. This
option can be used both in your global configuration and in
.htaccess files, this way you can have different layouts in
different parts of your gallery.
No default value, this option is required.
GalleryInfo
With this option you can define which EXIF information you would
like to present from the image. The format is: '<MyName =>
KeyInEXIF, MyOtherName => OtherKeyInEXIF'
Examples of keys: ShutterSpeedValue, ApertureValue, SubjectDistance,
and Camera
You can view all the keys from the EXIF header using this
perl-oneliner:
perl "-e" 'use Data::Dumper; use Image::Info qw(image_info); print
Dumper(image_info(shift));' filename.jpg
Default is: 'Picture Taken => DateTimeOriginal, Flash => Flash'
GallerySizes
Defines which widths images can be scaled to. Images cannot be
scaled to other widths than the ones you define with this option.
The default is '640 800 1024 1600'
GalleryThumbnailSize
Defines the width and height of the thumbnail images.
Defaults to '100x75'
GalleryThumbnailSizeLS
If set to '1', GalleryThumbnailSize is the long and the short side
of the thumbnail image instead of the width and height.
Defaults to '0'.
GalleryCopyrightImage
Image you want to blend into your images in the lower right corner.
This could be a transparent png saying "copyright my name 2001".
Optional.
GalleryWrapNavigation
Make the navigation in the picture view wrap around (So Next at the
end displays the first picture, etc.)
Set to 1 or 0, default is 0
GalleryAllowOriginal
Allow the user to download the Original picture without resizing or
putting the CopyrightImage on it.
Set to 1 or 0, default is 0
GallerySlideshowIntervals
With this option you can configure which intervals can be selected
for a slideshow. The default is '3 5 10 15 30'
GallerySortBy
Instead of the default filename ordering you can sort by any stat
attribute. For example size, atime, mtime, ctime.
GalleryMemoize
Cache EXIF data using Memoize - this will make Apache::Gallery
faster when many people access the same images, but it will also
cache EXIF data until the current Apache child dies.
GalleryEXIFMode
You can choose how Apache::Gallery should display EXIF info from
your images.
The default setting is 'namevalue'. This setting will make
Apache::Gallery print out the names and values of the EXIF values
you configure with GalleryInfo. The information will be parsed into
$INFO in pictureinfo.tpl.
You can also set it to 'values' which will make A::G parse the
configured values into the var $EXIFVALUES as 'value | value |
value'
If you set this option to 'variables' the items you configure in
GalleryInfo will be available to your templates as $EXIF_<KEYNAME>
(in all uppercase). That means that with the default setting
"Picture Taken => DateTimeOriginal, Flash => Flash" you will have
the variables $EXIF_DATETIMEORIGINAL and $EXIF_FLASH available to
your templates. You can place them anywhere you want.
GalleryRootPath
Change the location of gallery root. The default is ""
GalleryRootText
Change the name that appears as the root element in the menu. The
default is "root:"
GalleryMaxThumbnailsPerPage
This options controls how many thumbnails should be displayed in a
page. It requires $BROWSELINKS to be in the index.tpl template file.
GalleryImgFile
Pattern matching the files you want Apache::Gallery to view in the
index as thumbnails.
The default is '\.(jpe?g|png|tiff?|ppm)$'
GalleryVidFile
Pattern matching the files you want Apache::Gallery to view in the
index as videos.
Only types supported by HTML 5 should be included.
The default is '\.(ogv|ogx|m4v|mp4|webm)$'
GalleryDocFile
Pattern matching the files you want Apache::Gallery to view in the
index as normal files. All other filetypes will still be served by
Apache::Gallery but are not visible in the index.
The default is
'\.(mp3|m4a|ogg|wav|flac|od.|xlsx?|pptx?|docx?|pdf|rtf|txt|html?|csv|eps)$'
GalleryTTFDir
To use the GalleryCopyrightText feature you must set this option to
the directory where your True Type fonts are stored. No default is
set.
Example:
PerlSetVar GalleryTTFDir '/usr/share/fonts/'
GalleryTTFFile
To use the GalleryCopyrightText feature this option must be set to
the name of the True Type font you wish to use. Example:
PerlSetVar GalleryTTFFile 'verdanab.ttf'
GalleryTTFSize
Configure the size of the CopyrightText that will be inserted as
copyright notice in the corner of your pictures.
Example:
PerlSetVar GalleryTTFSize '10'
GalleryCopyrightText
The text that will be inserted as copyright notice.
Example:
PerlSetVar GalleryCopyrightText '(c) Michael Legart'
GalleryCopyrightColor
The text color of your copyright notice.
Examples:
White: PerlSetVar GalleryCopyrightColor '255,255,255,255'
Black: PerlSetVar GalleryCopyrightColor '0,0,0,255'
Red: PerlSetVar GalleryCopyrightColor '255,0,0,255'
Green: PerlSetVar GalleryCopyrightColor '0,255,0,255'
Blue: PerlSetVar GalleryCopyrightColor '0,0,255,255'
Transparent orange: PerlSetVar GalleryCopyrightColor '255,127,0,127'
GalleryCopyrightBackgroundColor
The background-color of a GalleryCopyrightText
r,g,b,a - for examples, see GalleryCopyrightColor
GalleryQuality
The quality (1-100) of scaled images
This setting affects the quality of the scaled images. Set this to a
low number to reduce the size of the scaled images. Remember to
clear out your cache if you change this setting. Quality seems to
default to 75, at least in the jpeg and png loader code in Imlib2
1.1.0.
Examples:
Quality at 50: PerlSetVar GalleryQuality '50'
GalleryUnderscoresToSpaces
Set this option to 1 to convert underscores to spaces in the listing
of directory and file names, as well as in the alt attribute for
HTML <img> tags.
GalleryCommentExifKey
Set this option to e.g. ImageDescription to use this field as
comments for images.
GalleryEnableMediaRss
Set this option to 1 to enable generation of a media RSS feed. This
can be used e.g. together with the PicLens plugin from
http://piclens.com
FEATURES
Ignore directories/files
To ignore a directory or a file (of any kind, not only images) you
create a <directory|file>.ignore file.
To hide a directory or a file from finding it by browsing, whilst
still allowing direct access if the name is known, create a
<directory|file>.noindex file.
Comments
To include comments for a directory you create a <directory>.comment
file where the first line can contain "TITLE: New title" which will
be the title of the page, and a comment on the following lines. To
include comments for each picture you create files called
picture.jpg.comment where the first line can contain "TITLE: New
title" which will be the title of the page, and a comment on the
following lines.
Example:
TITLE: This is the new title of the page
And this is the comment.<br />
And this is line two of the comment.
The visible name of the folder is by default identical to the name
of the folder, but can be changed by creating a file
<directory>.folder with the visible name of the folder.
It is also possible to set GalleryCommentExifKey to the name of an
EXIF field containing the comment, e.g. ImageDescription. The EXIF
comment is overridden by the .comment file if it exists.
DEPENDENCIES
Perl 5
Apache with mod_perl
URI::Escape
Image::Info
Image::Size
Text::Template
Image::Imlib2
Imlib2 Remember the -dev package when using rpm, deb or other package
formats!
AUTHOR
Michael Legart <[email protected]>
Modifications by Matthew Blissett <[email protected]>. See source
code on GitHub for details: <https://github.com/MattBlissett/Apache-Gallery>
COPYRIGHT AND LICENSE
Copyright © 2001-2011 Michael Legart <[email protected]>
'default' template designed by Thomas Kjaer <[email protected]>
'modern' template designed by Matthew Blissett.
Apache::Gallery is free software and is released under the Artistic
License. See http://www.perl.com/language/misc/Artistic.html for
details.
The video icons are from the GNOME project. http://www.gnome.org/
THANKS
Thanks to Thomas Kjaer for templates and design of
http://apachegallery.dk Thanks to Thomas Eibner and other for patches.
(See the Changes file)
SEE ALSO
perl, mod_perl, Image::Imlib2, CGI::FastTemplate, Image::Info, and
Image::Size.