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
|
#!/usr/bin/perl
# Copyright © 2009,2010 by Daniel Friesel <derf@derf.homelinux.org>
# License: WTFPL <http://sam.zoy.org/wtfpl>
use strict;
use warnings;
use autodie;
use App::Dthumb;
use Getopt::Long qw(:config no_ignore_case);
my $opt = {};
GetOptions(
$opt,
qw{
size|d=i
spacing|s=f
no-names|n
quality|q=i
archive|x
},
) or die("Please see perldoc -F $0\n");
my $dthumb = App::Dthumb->new($opt);
$dthumb->run();
__END__
=head1 NAME
dthumb - Generate Thumbnails + Index for a set of images
=head1 SYNOPSIS
B<dthumb> [I<options>]
=head1 DESCRIPTION
dthumb will create an F<index.xhtml> with a list (thumbnails) of
all images found in the current directory; the thumbnails will link to the
images.
The F<index.xhtml> file will always be created in the current directory, the
thumbnails will be saved in F<.thumbs> below it.
Note that recursion is not yet supported.
=head1 OPTIONS
=over
=item B<-x>, B<--archive>
Create (and link) an "image.tar" archive containing all full-size image files.
All but the last directories in the files' path are stripped, besides that the
directory structure is preserved. So, if you run dthumb -x in
.../mydir/, the archive will contain mydir/1.jpg, mydir/2.jpg etc.
=item B<-n>, B<--no-names>
Do not show image names below thumbnails
=item B<-d>, B<--size> I<pixels>
Maximum thumbnail size (either width or height). Defaults to 200
=item B<-s>, B<--spacing> I<float>
Use I<float> as spacing factor.
The size of each image element (image + possible border around it) is the
number of pixels (see --size) times I<float>.
So for B<1.1> you have a small border around each image, for B<1.0> you have
no border at all, etc.
=item B<-q>, B<--quality> I<int>
Set thumbnail quality.
Accepts values between 0 and 100, where 100 is the highest possible quality
=back
=head1 EXIT STATUS
Zero upon success, non-zero otherwise.
=head1 CONFIGURATION
None.
=head1 DEPENDENCIES
=over
=item * autodie (Included in core as of perl 5.10.1)
=item * Archive::Tar (subject to change)
=item * Image::Imlib2
=back
=head1 BUGS AND LIMITATIONS
Thumbnails of changed images are not yet recreated.
When used with B<-x>, the completer tar archive is kept in memory, leading to
enormous memory usage and possibly out-of-memory errors.
=head1 AUTHOR
Copyright (C) 2009, 2010 by Daniel Friesel E<lt>derf@chaosdorf.deE<gt>
The lightbox code is (C) by Lokesh Dhakar
E<lt>http://huddletogether.com/projects/lightbox/E<gt>, licensed under
CC-BY-2.5
=head1 LICENSE
0. You just DO WHAT THE FUCK YOU WANT TO
|