]>
Commit | Line | Data |
---|---|---|
b1336dac MG |
1 | #!/usr/bin/perl -w |
2 | use v5.14; | |
3 | ||
4 | use App::Gallery; | |
5 | use Getopt::Long; | |
6 | ||
7 | my %args; | |
8 | ||
9 | GetOptions ( | |
10 | 'out|o=s' => \$args{out}, | |
11 | 'tmpl=s' => \$args{tmpl}, | |
12 | 'title=s' => \$args{title}, | |
13 | 'width=i' => \$args{width}, | |
14 | 'height=i' => \$args{height}, | |
15 | ); | |
16 | ||
17 | die "Argument --out PATH is mandatory\n" unless $args{out}; | |
18 | ||
19 | App::Gallery->run(\%args, @ARGV); | |
20 | ||
21 | __END__ | |
22 | ||
23 | =encoding utf-8 | |
24 | ||
25 | =head1 NAME | |
26 | ||
27 | gallery.pl - very basic image gallery script | |
28 | ||
29 | =head1 SYNOPSIS | |
30 | ||
31 | gallery.pl --out DIR [--tmpl TEMPLATE] | |
32 | [--width PIXELS] [--height PIXELS] [--title TITLE] IMAGE... | |
33 | ||
34 | =head1 DESCRIPTION | |
35 | ||
36 | gallery.pl creates basic image galleries. Pass an output directory and | |
37 | a list of images to the script. The images will be hard linked into | |
38 | the directory (or copied if hard linking fails), then thumbnails will | |
39 | be created for the images, and finally an F<index.html> file linking | |
40 | to all the images will be created in the directory. | |
41 | ||
42 | =head1 OPTIONS | |
43 | ||
44 | =over | |
45 | ||
46 | =item B<--out> I<path> | |
47 | ||
48 | Directory to create everything in. Created if it does not exist. Mandatory. | |
49 | ||
50 | =item B<--tmpl> I<template> | |
51 | ||
52 | Path to template file, in HTML::Template::Compiled format. | |
53 | ||
54 | =item B<--width> I<width> | |
55 | ||
56 | Maximum width of thumbnails, in pixels. Defaults to 600. | |
57 | ||
58 | =item B<--height> I<height> | |
59 | ||
60 | Maximum height of thumbnails, in pixels. Defaults to 600. | |
61 | ||
62 | =item B<--title> I<title> | |
63 | ||
64 | Title of HTML page. Defaults to 'Gallery'. | |
65 | ||
66 | =back | |
67 | ||
68 | =head1 AUTHOR | |
69 | ||
70 | Marius Gavrilescu, E<lt>marius@ieval.roE<gt> | |
71 | ||
72 | =head1 COPYRIGHT AND LICENSE | |
73 | ||
74 | Copyright (C) 2017 by Marius Gavrilescu | |
75 | ||
76 | This library is free software; you can redistribute it and/or modify | |
77 | it under the same terms as Perl itself, either Perl version 5.14.2 or, | |
78 | at your option, any later version of Perl 5 you may have available. |