line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Toader::Gallery; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
21795
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
140
|
|
4
|
4
|
|
|
4
|
|
21
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
85
|
|
5
|
4
|
|
|
4
|
|
19
|
use base 'Error::Helper'; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
919
|
|
6
|
4
|
|
|
4
|
|
1332
|
use Toader::isaToaderDir; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
88
|
|
7
|
4
|
|
|
4
|
|
3093
|
use Config::Tiny; |
|
4
|
|
|
|
|
4235
|
|
|
4
|
|
|
|
|
16858
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Toader::Gallery - Handle image galleries. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 VERSION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Version 0.1.0 |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.1.0'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 METHODS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 new |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
This initiates the object. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
There is one argument is required and this is a |
28
|
|
|
|
|
|
|
L object. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my $foo = Toader::AutoDoc->new($toader); |
31
|
|
|
|
|
|
|
if ( $foo->error ){ |
32
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub new{ |
38
|
0
|
|
|
0
|
1
|
|
my $toader=$_[1]; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $self={ |
41
|
|
|
|
|
|
|
error=>undef, |
42
|
|
|
|
|
|
|
errorString=>'', |
43
|
|
|
|
|
|
|
perror=>undef, |
44
|
|
|
|
|
|
|
dir=>undef, |
45
|
|
|
|
|
|
|
errorExtra=>{ |
46
|
|
|
|
|
|
|
flags=>{ |
47
|
|
|
|
|
|
|
1=>'noDirSpecified', |
48
|
|
|
|
|
|
|
2=>'notAtoaderDir', |
49
|
|
|
|
|
|
|
3=>'readConfigFailed', |
50
|
|
|
|
|
|
|
4=>'noConfig', |
51
|
|
|
|
|
|
|
5=>'nonNumericResolution', |
52
|
|
|
|
|
|
|
6=>'noSrcPath', |
53
|
|
|
|
|
|
|
7=>'noSrcURL', |
54
|
|
|
|
|
|
|
8=>'noOutputPath', |
55
|
|
|
|
|
|
|
9=>'noOutputURL', |
56
|
|
|
|
|
|
|
10=>'dirAlreadyInit', |
57
|
|
|
|
|
|
|
11=>'pathHelperErrored', |
58
|
|
|
|
|
|
|
12=>'notAtoaderObj', |
59
|
|
|
|
|
|
|
13=>'getVCSerrored', |
60
|
|
|
|
|
|
|
14=>'VCSusableErrored', |
61
|
|
|
|
|
|
|
15=>'underVCSerrored', |
62
|
|
|
|
|
|
|
16=>'VCSaddErrored', |
63
|
|
|
|
|
|
|
17=>'VCSdeleteErrored', |
64
|
|
|
|
|
|
|
18=>'noToaderObj', |
65
|
|
|
|
|
|
|
}, |
66
|
|
|
|
|
|
|
}, |
67
|
|
|
|
|
|
|
VCSusable=>0, |
68
|
|
|
|
|
|
|
}; |
69
|
0
|
|
|
|
|
|
bless $self; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
#if we have a Toader object, reel it in |
72
|
0
|
0
|
|
|
|
|
if ( ! defined( $toader ) ){ |
73
|
0
|
|
|
|
|
|
$self->{perror}=1; |
74
|
0
|
|
|
|
|
|
$self->{error}=18; |
75
|
0
|
|
|
|
|
|
$self->{errorString}='No Toader object specified'; |
76
|
0
|
|
|
|
|
|
$self->warn; |
77
|
0
|
|
|
|
|
|
return $self; |
78
|
|
|
|
|
|
|
} |
79
|
0
|
0
|
|
|
|
|
if ( ref( $toader ) ne "Toader" ){ |
80
|
0
|
|
|
|
|
|
$self->{perror}=1; |
81
|
0
|
|
|
|
|
|
$self->{error}=12; |
82
|
0
|
|
|
|
|
|
$self->{errorString}='The object specified is a "'.ref($toader).'"'; |
83
|
0
|
|
|
|
|
|
$self->warn; |
84
|
0
|
|
|
|
|
|
return $self; |
85
|
|
|
|
|
|
|
} |
86
|
0
|
|
|
|
|
|
$self->{toader}=$toader; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
#gets the Toader::VCS object |
89
|
0
|
|
|
|
|
|
$self->{vcs}=$self->{toader}->getVCS; |
90
|
0
|
0
|
|
|
|
|
if ( $toader->error ){ |
91
|
0
|
|
|
|
|
|
$self->{perror}=1; |
92
|
0
|
|
|
|
|
|
$self->{error}=13; |
93
|
|
|
|
|
|
|
$self->{errorString}='Toader->getVCS errored. error="'. |
94
|
0
|
|
|
|
|
|
$self->{toader}->error.'" errorString="'.$self->{toader}->errorString.'"'; |
95
|
0
|
|
|
|
|
|
$self->warn; |
96
|
0
|
|
|
|
|
|
return $self; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
#checks if VCS is usable |
100
|
0
|
|
|
|
|
|
$self->{VCSusable}=$self->{vcs}->usable; |
101
|
0
|
0
|
|
|
|
|
if ( $self->{vcs}->error ){ |
102
|
0
|
|
|
|
|
|
$self->{perror}=1; |
103
|
0
|
|
|
|
|
|
$self->{error}=14; |
104
|
|
|
|
|
|
|
$self->{errorString}='Toader::VCS->usable errored. error="'. |
105
|
0
|
|
|
|
|
|
$self->{toader}->error.'" errorString="'.$self->{toader}->errorString.'"'; |
106
|
0
|
|
|
|
|
|
$self->warn; |
107
|
0
|
|
|
|
|
|
return $self; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
|
return $self; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 delConfig |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This removes a gallery config for a directory. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub delConfig{ |
120
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
121
|
|
|
|
|
|
|
|
122
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
123
|
0
|
|
|
|
|
|
return undef; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
127
|
0
|
|
|
|
|
|
$self->{error}=4; |
128
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
129
|
0
|
|
|
|
|
|
$self->warn; |
130
|
0
|
|
|
|
|
|
return undef; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
0
|
|
|
|
|
|
my $file=$self->{dir}.'/.toader/gallery.ini'; |
134
|
0
|
0
|
|
|
|
|
if ( ! unlink( $file ) ){ |
135
|
0
|
|
|
|
|
|
$self->{error}=11; |
136
|
0
|
|
|
|
|
|
$self->{errorString}='Failed to write the config out to "'.$file.'"'; |
137
|
0
|
|
|
|
|
|
$self->warn; |
138
|
0
|
|
|
|
|
|
return undef; |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
#if VCS is not usable, stop here |
142
|
0
|
0
|
|
|
|
|
if ( ! $self->{VCSusable} ){ |
143
|
0
|
|
|
|
|
|
return 1; |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
#if it is under VCS, we have nothing to do |
147
|
0
|
|
|
|
|
|
my $underVCS=$self->{vcs}->underVCS($file); |
148
|
0
|
0
|
|
|
|
|
if ( $self->{vcs}->error ){ |
149
|
0
|
|
|
|
|
|
$self->{error}=15; |
150
|
|
|
|
|
|
|
$self->{errorString}='Toader::VCS->underVCS errored. error="'. |
151
|
0
|
|
|
|
|
|
$self->{vcs}->error.'" errorString="'.$self->{vcs}->errorString.'"'; |
152
|
0
|
|
|
|
|
|
$self->warn; |
153
|
0
|
|
|
|
|
|
return undef; |
154
|
|
|
|
|
|
|
} |
155
|
0
|
0
|
|
|
|
|
if ( $underVCS ){ |
156
|
0
|
|
|
|
|
|
return 1; |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
#delete it as if we reach here it is not under VCS and VCS is being used |
160
|
0
|
|
|
|
|
|
$self->{vcs}->delete( $file ); |
161
|
0
|
0
|
|
|
|
|
if ( $self->{vcs}->error ){ |
162
|
0
|
|
|
|
|
|
$self->{error}=17; |
163
|
|
|
|
|
|
|
$self->{errorString}='Toader::VCS->delete errored. error="'. |
164
|
0
|
|
|
|
|
|
$self->{vcs}->error.'" errorString="'.$self->{vcs}->errorString.'"'; |
165
|
0
|
|
|
|
|
|
$self->warn; |
166
|
0
|
|
|
|
|
|
return undef; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
0
|
|
|
|
|
|
return 1; |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head2 dirGet |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
This gets L directory this entry is associated with. |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
This will only error if a permanent error is set. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
This will return undef if no directory has been set. |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
my $dir=$foo->dirGet; |
181
|
|
|
|
|
|
|
if($foo->error){ |
182
|
|
|
|
|
|
|
warn('Error:'.$foo->error.': '.$foo->errorString); |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=cut |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
sub dirGet{ |
188
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
189
|
|
|
|
|
|
|
|
190
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
191
|
0
|
|
|
|
|
|
return undef; |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
|
194
|
0
|
|
|
|
|
|
return $self->{dir}; |
195
|
|
|
|
|
|
|
} |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=head2 dirSet |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
This sets L directory this entry is associated with. |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
One argument is taken and it is the L directory to set it to. |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
my $dir=$foo->dirSet($toaderDirectory); |
204
|
|
|
|
|
|
|
if($foo->error){ |
205
|
|
|
|
|
|
|
warn('Error:'.$foo->error.': '.$foo->errorString); |
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=cut |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
sub dirSet{ |
211
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
212
|
0
|
|
|
|
|
|
my $dir=$_[1]; |
213
|
|
|
|
|
|
|
|
214
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
215
|
0
|
|
|
|
|
|
return undef; |
216
|
|
|
|
|
|
|
} |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
#make sure a directory has been specified |
219
|
0
|
0
|
|
|
|
|
if (!defined($dir)) { |
220
|
0
|
|
|
|
|
|
$self->{error}=1; |
221
|
0
|
|
|
|
|
|
$self->{errorString}='No directory specified.'; |
222
|
0
|
|
|
|
|
|
$self->warn; |
223
|
0
|
|
|
|
|
|
return undef; |
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
#cleans up the naming |
227
|
0
|
|
|
|
|
|
my $pathHelper=Toader::pathHelper->new($dir); |
228
|
0
|
0
|
|
|
|
|
if ( $pathHelper->error ){ |
229
|
0
|
|
|
|
|
|
$self->{error}=11; |
230
|
0
|
|
|
|
|
|
$self->{errorString}='Failed to initialize Toader::pathHelper'; |
231
|
0
|
|
|
|
|
|
$self->warn; |
232
|
0
|
|
|
|
|
|
return undef; |
233
|
|
|
|
|
|
|
} |
234
|
0
|
|
|
|
|
|
$dir=$pathHelper->cleanup( $dir ); |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
#checks if the directory is Toader directory or not |
237
|
0
|
|
|
|
|
|
my $isatd=Toader::isaToaderDir->new; |
238
|
0
|
|
|
|
|
|
my $returned=$isatd->isaToaderDir($dir); |
239
|
0
|
0
|
|
|
|
|
if (! $returned ) { |
240
|
0
|
|
|
|
|
|
$self->{error}=2; |
241
|
0
|
|
|
|
|
|
$self->{errorString}='"'.$dir.'" is not a Toader directory.'; |
242
|
0
|
|
|
|
|
|
$self->warn; |
243
|
0
|
|
|
|
|
|
return undef; |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
0
|
|
|
|
|
|
$self->{dir}=$dir; |
247
|
|
|
|
|
|
|
|
248
|
0
|
0
|
|
|
|
|
if ( defined( $self->{config} ) ){ |
249
|
0
|
|
|
|
|
|
delete( $self->{config} ); |
250
|
|
|
|
|
|
|
} |
251
|
|
|
|
|
|
|
|
252
|
0
|
|
|
|
|
|
my $configfile=$self->{dir}.'/.toader/gallery.ini'; |
253
|
0
|
0
|
|
|
|
|
if ( -f $configfile ){ |
254
|
0
|
|
|
|
|
|
$self->{config}=Config::Tiny->read( $configfile ); |
255
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
256
|
0
|
|
|
|
|
|
$self->{error}=3; |
257
|
0
|
|
|
|
|
|
$self->{errorString}='Failed to read the gallery config, "'.$configfile.'",'; |
258
|
0
|
|
|
|
|
|
$self->warn; |
259
|
0
|
|
|
|
|
|
return undef; |
260
|
|
|
|
|
|
|
} |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
|
263
|
0
|
|
|
|
|
|
return 1; |
264
|
|
|
|
|
|
|
} |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
=head2 init |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
This is initializes the config for a directory. This is automatically |
269
|
|
|
|
|
|
|
called if it has not been done so for a directory. |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=cut |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
sub init{ |
274
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
275
|
|
|
|
|
|
|
|
276
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
277
|
0
|
|
|
|
|
|
return undef; |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
0
|
0
|
|
|
|
|
if ( defined( $self->{config} ) ){ |
281
|
0
|
|
|
|
|
|
$self->{error}=10; |
282
|
0
|
|
|
|
|
|
$self->{errorString}='"'.$self->{dir}.'" has already been initialized'; |
283
|
0
|
|
|
|
|
|
$self->warn; |
284
|
0
|
|
|
|
|
|
return undef; |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
|
287
|
0
|
|
|
|
|
|
$self->{config}=Config::Tiny->new; |
288
|
0
|
|
|
|
|
|
$self->writeConfig; |
289
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
290
|
0
|
|
|
|
|
|
$self->warnString('Failed to write the config out'); |
291
|
0
|
|
|
|
|
|
return undef; |
292
|
|
|
|
|
|
|
} |
293
|
|
|
|
|
|
|
|
294
|
0
|
|
|
|
|
|
return 1; |
295
|
|
|
|
|
|
|
} |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=head2 outputPathGet |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
This returns the output path. |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
my $outputPath=$foo->outputPathGet; |
302
|
|
|
|
|
|
|
if ( $foo->error ){ |
303
|
|
|
|
|
|
|
warn( 'error:'.$foo->error.': '.$foo->errorString ); |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=cut |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
sub outputPathGet{ |
309
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
310
|
|
|
|
|
|
|
|
311
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
312
|
0
|
|
|
|
|
|
return undef; |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
|
315
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
316
|
0
|
|
|
|
|
|
$self->{error}=4; |
317
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
318
|
0
|
|
|
|
|
|
$self->warn; |
319
|
0
|
|
|
|
|
|
return undef; |
320
|
|
|
|
|
|
|
} |
321
|
|
|
|
|
|
|
|
322
|
0
|
|
|
|
|
|
return $self->{config}->{'_'}->{'outputPath'}; |
323
|
|
|
|
|
|
|
} |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=head2 outputPathSet |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
This returns the output path. |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
$foo->outputPathSet( $outputPath ); |
330
|
|
|
|
|
|
|
if ( $foo->error ){ |
331
|
|
|
|
|
|
|
warn( 'error:'.$foo->error.': '.$foo->errorString ); |
332
|
|
|
|
|
|
|
} |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=cut |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
sub outputPathSet{ |
337
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
338
|
0
|
|
|
|
|
|
my $outputPath=$_[1]; |
339
|
|
|
|
|
|
|
|
340
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
341
|
0
|
|
|
|
|
|
return undef; |
342
|
|
|
|
|
|
|
} |
343
|
|
|
|
|
|
|
|
344
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
345
|
0
|
|
|
|
|
|
$self->init; |
346
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
347
|
0
|
|
|
|
|
|
$self->warnString('Failed to initialize the gallery config'); |
348
|
0
|
|
|
|
|
|
return undef; |
349
|
|
|
|
|
|
|
} |
350
|
|
|
|
|
|
|
} |
351
|
|
|
|
|
|
|
|
352
|
0
|
0
|
|
|
|
|
if ( ! defined( $outputPath ) ){ |
353
|
0
|
|
|
|
|
|
$self->{error}=8; |
354
|
0
|
|
|
|
|
|
$self->{errorString}='No output path specified'; |
355
|
|
|
|
|
|
|
} |
356
|
|
|
|
|
|
|
|
357
|
0
|
|
|
|
|
|
$self->{config}->{'_'}->{'outputPath'}=$outputPath; |
358
|
|
|
|
|
|
|
|
359
|
0
|
|
|
|
|
|
$self->writeConfig; |
360
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
361
|
0
|
|
|
|
|
|
$self->warnString('Failed to write the config out'); |
362
|
0
|
|
|
|
|
|
return undef; |
363
|
|
|
|
|
|
|
} |
364
|
|
|
|
|
|
|
|
365
|
0
|
|
|
|
|
|
return 1; |
366
|
|
|
|
|
|
|
} |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
=head2 outputURLget |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
This returns the output path. |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
my $outputURL=$foo->outputURLget; |
373
|
|
|
|
|
|
|
if ( $foo->error ){ |
374
|
|
|
|
|
|
|
warn( 'error:'.$foo->error.': '.$foo->errorString ); |
375
|
|
|
|
|
|
|
} |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
=cut |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
sub outputURLget{ |
380
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
381
|
|
|
|
|
|
|
|
382
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
383
|
0
|
|
|
|
|
|
return undef; |
384
|
|
|
|
|
|
|
} |
385
|
|
|
|
|
|
|
|
386
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
387
|
0
|
|
|
|
|
|
$self->{error}=4; |
388
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
389
|
0
|
|
|
|
|
|
$self->warn; |
390
|
0
|
|
|
|
|
|
return undef; |
391
|
|
|
|
|
|
|
} |
392
|
|
|
|
|
|
|
|
393
|
0
|
|
|
|
|
|
return $self->{config}->{'_'}->{'outputURL'}; |
394
|
|
|
|
|
|
|
} |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
=head2 outputURLset |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
This sets the output URL. |
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
my $outputURL=$foo->outputURLget; |
401
|
|
|
|
|
|
|
if ( $foo->error ){ |
402
|
|
|
|
|
|
|
warn( 'error:'.$foo->error.': '.$foo->errorString ); |
403
|
|
|
|
|
|
|
} |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
=cut |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
sub outputURLset{ |
408
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
409
|
0
|
|
|
|
|
|
my $outputURL=$_[1]; |
410
|
|
|
|
|
|
|
|
411
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
412
|
0
|
|
|
|
|
|
return undef; |
413
|
|
|
|
|
|
|
} |
414
|
|
|
|
|
|
|
|
415
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
416
|
0
|
|
|
|
|
|
$self->init; |
417
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
418
|
0
|
|
|
|
|
|
$self->warnString('Failed to initialize the gallery config'); |
419
|
0
|
|
|
|
|
|
return undef; |
420
|
|
|
|
|
|
|
} |
421
|
|
|
|
|
|
|
} |
422
|
|
|
|
|
|
|
|
423
|
0
|
0
|
|
|
|
|
if ( ! defined( $outputURL ) ){ |
424
|
0
|
|
|
|
|
|
$self->{error}=9; |
425
|
0
|
|
|
|
|
|
$self->{errorString}='No output URL specified'; |
426
|
0
|
|
|
|
|
|
$self->warn; |
427
|
0
|
|
|
|
|
|
return undef; |
428
|
|
|
|
|
|
|
} |
429
|
|
|
|
|
|
|
|
430
|
0
|
|
|
|
|
|
$self->{config}->{'_'}->{'outputURL'}=$outputURL; |
431
|
|
|
|
|
|
|
|
432
|
0
|
|
|
|
|
|
$self->writeConfig; |
433
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
434
|
0
|
|
|
|
|
|
$self->warnString('Failed to write the config out'); |
435
|
0
|
|
|
|
|
|
return undef; |
436
|
|
|
|
|
|
|
} |
437
|
|
|
|
|
|
|
|
438
|
0
|
|
|
|
|
|
return 1; |
439
|
|
|
|
|
|
|
} |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
=head2 srcPathGet |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
This returns the source path. |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
my $srcPath=$foo->srcPath; |
446
|
|
|
|
|
|
|
if ( $foo->error ){ |
447
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
448
|
|
|
|
|
|
|
} |
449
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
=cut |
451
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
sub srcPathGet{ |
453
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
454
|
|
|
|
|
|
|
|
455
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
456
|
0
|
|
|
|
|
|
return undef; |
457
|
|
|
|
|
|
|
} |
458
|
|
|
|
|
|
|
|
459
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
460
|
0
|
|
|
|
|
|
$self->{error}=4; |
461
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
462
|
0
|
|
|
|
|
|
$self->warn; |
463
|
0
|
|
|
|
|
|
return undef; |
464
|
|
|
|
|
|
|
} |
465
|
|
|
|
|
|
|
|
466
|
0
|
|
|
|
|
|
return $self->{config}->{'_'}->{'srcPath'}; |
467
|
|
|
|
|
|
|
} |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
=head2 srcPathSet |
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
This sets the that to search for images. |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
One argument is required and it is a path. |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
$foo->srcPathSet( $srcPath ); |
476
|
|
|
|
|
|
|
if ( $foo->error ){ |
477
|
|
|
|
|
|
|
warn( 'error:'.$foo->error.': '.$foo->errorString ); |
478
|
|
|
|
|
|
|
} |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
=cut |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
sub srcPathSet{ |
483
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
484
|
0
|
|
|
|
|
|
my $srcPath=$_[1]; |
485
|
|
|
|
|
|
|
|
486
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
487
|
0
|
|
|
|
|
|
return undef; |
488
|
|
|
|
|
|
|
} |
489
|
|
|
|
|
|
|
|
490
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
491
|
0
|
|
|
|
|
|
$self->init; |
492
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
493
|
0
|
|
|
|
|
|
$self->warnString('Failed to initialize the gallery config'); |
494
|
0
|
|
|
|
|
|
return undef; |
495
|
|
|
|
|
|
|
} |
496
|
|
|
|
|
|
|
} |
497
|
|
|
|
|
|
|
|
498
|
0
|
0
|
|
|
|
|
if ( ! defined( $srcPath ) ){ |
499
|
0
|
|
|
|
|
|
$self->{error}=6; |
500
|
0
|
|
|
|
|
|
$self->{errorString}='No source path specified'; |
501
|
|
|
|
|
|
|
} |
502
|
|
|
|
|
|
|
|
503
|
0
|
|
|
|
|
|
$self->{config}->{'_'}->{'srcPath'}=$srcPath; |
504
|
|
|
|
|
|
|
|
505
|
0
|
|
|
|
|
|
$self->writeConfig; |
506
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
507
|
0
|
|
|
|
|
|
$self->warnString('Failed to write the config out'); |
508
|
0
|
|
|
|
|
|
return undef; |
509
|
|
|
|
|
|
|
} |
510
|
|
|
|
|
|
|
|
511
|
0
|
|
|
|
|
|
return 1; |
512
|
|
|
|
|
|
|
} |
513
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
=head2 srcURLget |
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
This gets the URL to use for the images. |
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
my $srcURLget=$foo->srcURLget; |
519
|
|
|
|
|
|
|
if ( $foo->error ){ |
520
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
521
|
|
|
|
|
|
|
} |
522
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
=cut |
524
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
sub srcURLget{ |
526
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
527
|
|
|
|
|
|
|
|
528
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
529
|
0
|
|
|
|
|
|
return undef; |
530
|
|
|
|
|
|
|
} |
531
|
|
|
|
|
|
|
|
532
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
533
|
0
|
|
|
|
|
|
$self->{error}=4; |
534
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
535
|
0
|
|
|
|
|
|
$self->warn; |
536
|
0
|
|
|
|
|
|
return undef; |
537
|
|
|
|
|
|
|
} |
538
|
|
|
|
|
|
|
|
539
|
0
|
|
|
|
|
|
return $self->{config}->{'_'}->{'srcURL'}; |
540
|
|
|
|
|
|
|
} |
541
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
=head2 srcURLset |
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
This sets the URL that is used for linking to the source images. |
545
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
$foo->srcURLset( $url ); |
547
|
|
|
|
|
|
|
if ( $foo->error ){ |
548
|
|
|
|
|
|
|
warn( 'error:'.$foo->error.': '.$foo->errorString ); |
549
|
|
|
|
|
|
|
} |
550
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
=cut |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
sub srcURLset{ |
554
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
555
|
0
|
|
|
|
|
|
my $srcURL=$_[1]; |
556
|
|
|
|
|
|
|
|
557
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
558
|
0
|
|
|
|
|
|
return undef; |
559
|
|
|
|
|
|
|
} |
560
|
|
|
|
|
|
|
|
561
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
562
|
0
|
|
|
|
|
|
$self->init; |
563
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
564
|
0
|
|
|
|
|
|
$self->warnString('Failed to initialize the gallery config'); |
565
|
0
|
|
|
|
|
|
return undef; |
566
|
|
|
|
|
|
|
} |
567
|
|
|
|
|
|
|
} |
568
|
|
|
|
|
|
|
|
569
|
0
|
0
|
|
|
|
|
if ( ! defined( $srcURL ) ){ |
570
|
0
|
|
|
|
|
|
$self->{error}=7; |
571
|
0
|
|
|
|
|
|
$self->{errorString}='Nothing specified for the source URL'; |
572
|
0
|
|
|
|
|
|
$self->warn; |
573
|
0
|
|
|
|
|
|
return undef; |
574
|
|
|
|
|
|
|
} |
575
|
|
|
|
|
|
|
|
576
|
0
|
|
|
|
|
|
$self->{config}->{'_'}->{'srcURL'}=$srcURL; |
577
|
|
|
|
|
|
|
|
578
|
0
|
|
|
|
|
|
$self->writeConfig; |
579
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
580
|
0
|
|
|
|
|
|
$self->warnString('Failed to write the config out'); |
581
|
0
|
|
|
|
|
|
return undef; |
582
|
|
|
|
|
|
|
} |
583
|
|
|
|
|
|
|
|
584
|
0
|
|
|
|
|
|
return 1; |
585
|
|
|
|
|
|
|
} |
586
|
|
|
|
|
|
|
|
587
|
|
|
|
|
|
|
=head2 renderUpdateDetailsGet |
588
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
Returns if upon rendering it should update image details or not. |
590
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
The return value is a Perl boolean. |
592
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
my $update=$foo->renderUpdateDetailsGet; |
594
|
|
|
|
|
|
|
if ( $foo->error ){ |
595
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
596
|
|
|
|
|
|
|
} |
597
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
=cut |
599
|
|
|
|
|
|
|
|
600
|
|
|
|
|
|
|
sub renderUpdateDetailsGet{ |
601
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
602
|
|
|
|
|
|
|
|
603
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
604
|
0
|
|
|
|
|
|
return undef; |
605
|
|
|
|
|
|
|
} |
606
|
|
|
|
|
|
|
|
607
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
608
|
0
|
|
|
|
|
|
$self->{error}=4; |
609
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
610
|
0
|
|
|
|
|
|
$self->warn; |
611
|
0
|
|
|
|
|
|
return undef; |
612
|
|
|
|
|
|
|
} |
613
|
|
|
|
|
|
|
|
614
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config}->{'_'}->{'renderUpdateDetails'} ) ){ |
615
|
0
|
|
|
|
|
|
return 0; |
616
|
|
|
|
|
|
|
} |
617
|
|
|
|
|
|
|
|
618
|
0
|
|
|
|
|
|
return $self->{config}->{'_'}->{'renderUpdateDetails'}; |
619
|
|
|
|
|
|
|
} |
620
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
=head2 renderUpdateDetailsSet |
622
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
This sets wether or note Toader::Render::Gallery->render should |
624
|
|
|
|
|
|
|
update the details or not. |
625
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
This takes a Perl boolean. |
627
|
|
|
|
|
|
|
|
628
|
|
|
|
|
|
|
$foo->renderUpdateDetailsGet( $update ); |
629
|
|
|
|
|
|
|
if ( $foo->error ){ |
630
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
631
|
|
|
|
|
|
|
} |
632
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
=cut |
634
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
sub renderUpdateDetailsSet{ |
636
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
637
|
0
|
|
|
|
|
|
my $update=$_[1]; |
638
|
|
|
|
|
|
|
|
639
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
640
|
0
|
|
|
|
|
|
return undef; |
641
|
|
|
|
|
|
|
} |
642
|
|
|
|
|
|
|
|
643
|
0
|
0
|
|
|
|
|
if ( ! defined( $update ) ){ |
644
|
0
|
|
|
|
|
|
$update=0; |
645
|
|
|
|
|
|
|
} |
646
|
|
|
|
|
|
|
|
647
|
0
|
0
|
|
|
|
|
if ( $update ){ |
648
|
0
|
|
|
|
|
|
$update=1; |
649
|
|
|
|
|
|
|
} |
650
|
|
|
|
|
|
|
|
651
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
652
|
0
|
|
|
|
|
|
$self->{error}=4; |
653
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
654
|
0
|
|
|
|
|
|
$self->warn; |
655
|
0
|
|
|
|
|
|
return undef; |
656
|
|
|
|
|
|
|
} |
657
|
|
|
|
|
|
|
|
658
|
0
|
|
|
|
|
|
$self->{config}->{'_'}->{'renderUpdateDetails'}=$update; |
659
|
|
|
|
|
|
|
|
660
|
0
|
|
|
|
|
|
return 1; |
661
|
|
|
|
|
|
|
} |
662
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
=head2 renderUpdateIndexesGet |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
Returns if upon rendering it should update the indexes or not. |
666
|
|
|
|
|
|
|
|
667
|
|
|
|
|
|
|
The return value is a Perl boolean. |
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
my $update=$foo->renderUpdateIndexesGet; |
670
|
|
|
|
|
|
|
if ( $foo->error ){ |
671
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
672
|
|
|
|
|
|
|
} |
673
|
|
|
|
|
|
|
|
674
|
|
|
|
|
|
|
=cut |
675
|
|
|
|
|
|
|
|
676
|
|
|
|
|
|
|
sub renderUpdateIndexesGet{ |
677
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
678
|
|
|
|
|
|
|
|
679
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
680
|
0
|
|
|
|
|
|
return undef; |
681
|
|
|
|
|
|
|
} |
682
|
|
|
|
|
|
|
|
683
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
684
|
0
|
|
|
|
|
|
$self->{error}=4; |
685
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
686
|
0
|
|
|
|
|
|
$self->warn; |
687
|
0
|
|
|
|
|
|
return undef; |
688
|
|
|
|
|
|
|
} |
689
|
|
|
|
|
|
|
|
690
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config}->{'_'}->{'renderUpdateIndexes'} ) ){ |
691
|
0
|
|
|
|
|
|
return 0; |
692
|
|
|
|
|
|
|
} |
693
|
|
|
|
|
|
|
|
694
|
0
|
|
|
|
|
|
return $self->{config}->{'_'}->{'renderUpdateIndexes'}; |
695
|
|
|
|
|
|
|
} |
696
|
|
|
|
|
|
|
|
697
|
|
|
|
|
|
|
=head2 renderUpdateIndexesSet |
698
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
This sets wether or note Toader::Render::Gallery->render should |
700
|
|
|
|
|
|
|
update the indexes or not. |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
This takes a Perl boolean. |
703
|
|
|
|
|
|
|
|
704
|
|
|
|
|
|
|
$foo->renderUpdateIndexesGet( $update ); |
705
|
|
|
|
|
|
|
if ( $foo->error ){ |
706
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
707
|
|
|
|
|
|
|
} |
708
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
=cut |
710
|
|
|
|
|
|
|
|
711
|
|
|
|
|
|
|
sub renderUpdateIndexesSet{ |
712
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
713
|
0
|
|
|
|
|
|
my $update=$_[1]; |
714
|
|
|
|
|
|
|
|
715
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
716
|
0
|
|
|
|
|
|
return undef; |
717
|
|
|
|
|
|
|
} |
718
|
|
|
|
|
|
|
|
719
|
0
|
0
|
|
|
|
|
if ( ! defined( $update ) ){ |
720
|
0
|
|
|
|
|
|
$update=0; |
721
|
|
|
|
|
|
|
} |
722
|
|
|
|
|
|
|
|
723
|
0
|
0
|
|
|
|
|
if ( $update ){ |
724
|
0
|
|
|
|
|
|
$update=1; |
725
|
|
|
|
|
|
|
} |
726
|
|
|
|
|
|
|
|
727
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
728
|
0
|
|
|
|
|
|
$self->{error}=4; |
729
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
730
|
0
|
|
|
|
|
|
$self->warn; |
731
|
0
|
|
|
|
|
|
return undef; |
732
|
|
|
|
|
|
|
} |
733
|
|
|
|
|
|
|
|
734
|
0
|
|
|
|
|
|
$self->{config}->{'_'}->{'renderUpdateIndexes'}=$update; |
735
|
|
|
|
|
|
|
|
736
|
0
|
|
|
|
|
|
return 1; |
737
|
|
|
|
|
|
|
} |
738
|
|
|
|
|
|
|
|
739
|
|
|
|
|
|
|
=head2 renderUpdateScaledGet |
740
|
|
|
|
|
|
|
|
741
|
|
|
|
|
|
|
Returns if upon rendering it should update the scaled images or not. |
742
|
|
|
|
|
|
|
|
743
|
|
|
|
|
|
|
The return value is a Perl boolean. |
744
|
|
|
|
|
|
|
|
745
|
|
|
|
|
|
|
my $update=$foo->renderUpdateIndexesGet; |
746
|
|
|
|
|
|
|
if ( $foo->error ){ |
747
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
748
|
|
|
|
|
|
|
} |
749
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
=cut |
751
|
|
|
|
|
|
|
|
752
|
|
|
|
|
|
|
sub renderUpdateScaledGet{ |
753
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
754
|
|
|
|
|
|
|
|
755
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
756
|
0
|
|
|
|
|
|
return undef; |
757
|
|
|
|
|
|
|
} |
758
|
|
|
|
|
|
|
|
759
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
760
|
0
|
|
|
|
|
|
$self->{error}=4; |
761
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
762
|
0
|
|
|
|
|
|
$self->warn; |
763
|
0
|
|
|
|
|
|
return undef; |
764
|
|
|
|
|
|
|
} |
765
|
|
|
|
|
|
|
|
766
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config}->{'_'}->{'renderUpdateScaled'} ) ){ |
767
|
0
|
|
|
|
|
|
return 0; |
768
|
|
|
|
|
|
|
} |
769
|
|
|
|
|
|
|
|
770
|
0
|
|
|
|
|
|
return $self->{config}->{'_'}->{'renderUpdateScaled'}; |
771
|
|
|
|
|
|
|
} |
772
|
|
|
|
|
|
|
|
773
|
|
|
|
|
|
|
=head2 renderUpdateScaledSet |
774
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
This sets wether or note Toader::Render::Gallery->render should |
776
|
|
|
|
|
|
|
update the scaled images or not. |
777
|
|
|
|
|
|
|
|
778
|
|
|
|
|
|
|
This takes a Perl boolean. |
779
|
|
|
|
|
|
|
|
780
|
|
|
|
|
|
|
$foo->renderUpdateIndexesGet( $update ); |
781
|
|
|
|
|
|
|
if ( $foo->error ){ |
782
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
783
|
|
|
|
|
|
|
} |
784
|
|
|
|
|
|
|
|
785
|
|
|
|
|
|
|
=cut |
786
|
|
|
|
|
|
|
|
787
|
|
|
|
|
|
|
sub renderUpdateScaledSet{ |
788
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
789
|
0
|
|
|
|
|
|
my $update=$_[1]; |
790
|
|
|
|
|
|
|
|
791
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
792
|
0
|
|
|
|
|
|
return undef; |
793
|
|
|
|
|
|
|
} |
794
|
|
|
|
|
|
|
|
795
|
0
|
0
|
|
|
|
|
if ( ! defined( $update ) ){ |
796
|
0
|
|
|
|
|
|
$update=0; |
797
|
|
|
|
|
|
|
} |
798
|
|
|
|
|
|
|
|
799
|
0
|
0
|
|
|
|
|
if ( $update ){ |
800
|
0
|
|
|
|
|
|
$update=1; |
801
|
|
|
|
|
|
|
} |
802
|
|
|
|
|
|
|
|
803
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
804
|
0
|
|
|
|
|
|
$self->{error}=4; |
805
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
806
|
0
|
|
|
|
|
|
$self->warn; |
807
|
0
|
|
|
|
|
|
return undef; |
808
|
|
|
|
|
|
|
} |
809
|
|
|
|
|
|
|
|
810
|
0
|
|
|
|
|
|
$self->{config}->{'_'}->{'renderUpdateScaled'}=$update; |
811
|
|
|
|
|
|
|
|
812
|
0
|
|
|
|
|
|
return 1; |
813
|
|
|
|
|
|
|
} |
814
|
|
|
|
|
|
|
|
815
|
|
|
|
|
|
|
=head2 resolutionSmallGet |
816
|
|
|
|
|
|
|
|
817
|
|
|
|
|
|
|
Returns the small resolution. |
818
|
|
|
|
|
|
|
|
819
|
|
|
|
|
|
|
my $smallRes=$foo->resolutionSmallGet; |
820
|
|
|
|
|
|
|
if ( $foo->error ){ |
821
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
822
|
|
|
|
|
|
|
} |
823
|
|
|
|
|
|
|
|
824
|
|
|
|
|
|
|
=cut |
825
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
sub resolutionSmallGet{ |
827
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
828
|
|
|
|
|
|
|
|
829
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
830
|
0
|
|
|
|
|
|
return undef; |
831
|
|
|
|
|
|
|
} |
832
|
|
|
|
|
|
|
|
833
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
834
|
0
|
|
|
|
|
|
$self->{error}=4; |
835
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
836
|
0
|
|
|
|
|
|
$self->warn; |
837
|
0
|
|
|
|
|
|
return undef; |
838
|
|
|
|
|
|
|
} |
839
|
|
|
|
|
|
|
|
840
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config}->{'_'}->{'smallResolution'} ) ){ |
841
|
0
|
|
|
|
|
|
return 200; |
842
|
|
|
|
|
|
|
} |
843
|
|
|
|
|
|
|
|
844
|
0
|
0
|
|
|
|
|
if ( $self->{config}->{'_'}->{'smallResolution'} !~ /^[0123456789]*$/ ){ |
845
|
0
|
|
|
|
|
|
$self->{error}=5; |
846
|
0
|
|
|
|
|
|
$self->{errorString}='"'.$self->{config}->{'_'}->{'smallResolution'}.'" is not numeric'; |
847
|
0
|
|
|
|
|
|
$self->warn; |
848
|
0
|
|
|
|
|
|
return undef; |
849
|
|
|
|
|
|
|
} |
850
|
|
|
|
|
|
|
|
851
|
0
|
|
|
|
|
|
return $self->{config}->{'_'}->{'smallResolution'}; |
852
|
|
|
|
|
|
|
} |
853
|
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
=head2 resolutionSmallSet |
855
|
|
|
|
|
|
|
|
856
|
|
|
|
|
|
|
Sets the small resolution. |
857
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
One argument is taken and that is the maximum resolution for a |
859
|
|
|
|
|
|
|
image. If not specified, it resets it to 200. |
860
|
|
|
|
|
|
|
|
861
|
|
|
|
|
|
|
my $smallRes=$foo->resolutionSmallSet( $resolution ); |
862
|
|
|
|
|
|
|
if ( $foo->error ){ |
863
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
864
|
|
|
|
|
|
|
} |
865
|
|
|
|
|
|
|
|
866
|
|
|
|
|
|
|
=cut |
867
|
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
sub resolutionSmallSet{ |
869
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
870
|
0
|
|
|
|
|
|
my $res=$_[1]; |
871
|
|
|
|
|
|
|
|
872
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
873
|
0
|
|
|
|
|
|
return undef; |
874
|
|
|
|
|
|
|
} |
875
|
|
|
|
|
|
|
|
876
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
877
|
0
|
|
|
|
|
|
$self->init; |
878
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
879
|
0
|
|
|
|
|
|
$self->warnString('Failed to initialize the gallery config'); |
880
|
0
|
|
|
|
|
|
return undef; |
881
|
|
|
|
|
|
|
} |
882
|
|
|
|
|
|
|
} |
883
|
|
|
|
|
|
|
|
884
|
0
|
0
|
|
|
|
|
if ( ! defined( $res ) ){ |
885
|
0
|
|
|
|
|
|
$res=200; |
886
|
|
|
|
|
|
|
} |
887
|
|
|
|
|
|
|
|
888
|
0
|
0
|
|
|
|
|
if ( $self->{config}->{'_'}->{'smallResolution'} !~ /^[0123456789]*$/ ){ |
889
|
0
|
|
|
|
|
|
$self->{error}=5; |
890
|
0
|
|
|
|
|
|
$self->{errorString}='"'.$self->{config}->{'_'}->{'smallResolution'}.'" is not numeric'; |
891
|
0
|
|
|
|
|
|
$self->warn; |
892
|
0
|
|
|
|
|
|
return undef; |
893
|
|
|
|
|
|
|
} |
894
|
|
|
|
|
|
|
|
895
|
0
|
|
|
|
|
|
$self->{config}->{'_'}->{'smallResolution'}=$res; |
896
|
|
|
|
|
|
|
|
897
|
0
|
|
|
|
|
|
$self->writeConfig; |
898
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
899
|
0
|
|
|
|
|
|
$self->warnString('Failed to write the config out'); |
900
|
0
|
|
|
|
|
|
return undef; |
901
|
|
|
|
|
|
|
} |
902
|
|
|
|
|
|
|
|
903
|
0
|
|
|
|
|
|
return 1; |
904
|
|
|
|
|
|
|
} |
905
|
|
|
|
|
|
|
|
906
|
|
|
|
|
|
|
=head2 resolutionLargeGet |
907
|
|
|
|
|
|
|
|
908
|
|
|
|
|
|
|
Returns the larg resolution. |
909
|
|
|
|
|
|
|
|
910
|
|
|
|
|
|
|
my $largeRes=$foo->resolutionLargeGet; |
911
|
|
|
|
|
|
|
if ( $foo->error ){ |
912
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
913
|
|
|
|
|
|
|
} |
914
|
|
|
|
|
|
|
|
915
|
|
|
|
|
|
|
=cut |
916
|
|
|
|
|
|
|
|
917
|
|
|
|
|
|
|
sub resolutionLargeGet{ |
918
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
919
|
|
|
|
|
|
|
|
920
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
921
|
0
|
|
|
|
|
|
return undef; |
922
|
|
|
|
|
|
|
} |
923
|
|
|
|
|
|
|
|
924
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
925
|
0
|
|
|
|
|
|
$self->{error}=4; |
926
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
927
|
0
|
|
|
|
|
|
$self->warn; |
928
|
0
|
|
|
|
|
|
return undef; |
929
|
|
|
|
|
|
|
} |
930
|
|
|
|
|
|
|
|
931
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config}->{'_'}->{'smallResolution'} ) ){ |
932
|
0
|
|
|
|
|
|
return 1024; |
933
|
|
|
|
|
|
|
} |
934
|
|
|
|
|
|
|
|
935
|
0
|
0
|
|
|
|
|
if ( $self->{config}->{'_'}->{'smallResolution'} !~ /^[0123456789]*$/ ){ |
936
|
0
|
|
|
|
|
|
$self->{error}=5; |
937
|
0
|
|
|
|
|
|
$self->{errorString}='"'.$self->{config}->{'_'}->{'smallResolution'}.'" is not numeric'; |
938
|
0
|
|
|
|
|
|
$self->warn; |
939
|
0
|
|
|
|
|
|
return undef; |
940
|
|
|
|
|
|
|
} |
941
|
|
|
|
|
|
|
|
942
|
0
|
|
|
|
|
|
return $self->{config}->{'_'}->{'smallResolution'}; |
943
|
|
|
|
|
|
|
} |
944
|
|
|
|
|
|
|
|
945
|
|
|
|
|
|
|
=head2 resolutionLargeSet |
946
|
|
|
|
|
|
|
|
947
|
|
|
|
|
|
|
Returns the larg resolution. |
948
|
|
|
|
|
|
|
|
949
|
|
|
|
|
|
|
One argument is taken is the maximum resolution to use. |
950
|
|
|
|
|
|
|
If not specified, it resets it to the default, 1024. |
951
|
|
|
|
|
|
|
|
952
|
|
|
|
|
|
|
$foo->resolutionLargeSet( $res ); |
953
|
|
|
|
|
|
|
if ( $foo->error ){ |
954
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
955
|
|
|
|
|
|
|
} |
956
|
|
|
|
|
|
|
|
957
|
|
|
|
|
|
|
=cut |
958
|
|
|
|
|
|
|
|
959
|
|
|
|
|
|
|
sub resolutionLargeSet{ |
960
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
961
|
0
|
|
|
|
|
|
my $res=$_[1]; |
962
|
|
|
|
|
|
|
|
963
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
964
|
0
|
|
|
|
|
|
return undef; |
965
|
|
|
|
|
|
|
} |
966
|
|
|
|
|
|
|
|
967
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
968
|
0
|
|
|
|
|
|
$self->init; |
969
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
970
|
0
|
|
|
|
|
|
$self->warnString('Failed to initialize the gallery config'); |
971
|
0
|
|
|
|
|
|
return undef; |
972
|
|
|
|
|
|
|
} |
973
|
|
|
|
|
|
|
} |
974
|
|
|
|
|
|
|
|
975
|
0
|
0
|
|
|
|
|
if ( ! defined( $res ) ){ |
976
|
0
|
|
|
|
|
|
$res=1024; |
977
|
|
|
|
|
|
|
} |
978
|
|
|
|
|
|
|
|
979
|
0
|
0
|
|
|
|
|
if ( $self->{config}->{'_'}->{'smallResolution'} !~ /^[0123456789]*$/ ){ |
980
|
0
|
|
|
|
|
|
$self->{error}=5; |
981
|
0
|
|
|
|
|
|
$self->{errorString}='"'.$self->{config}->{'_'}->{'smallResolution'}.'" is not numeric'; |
982
|
0
|
|
|
|
|
|
$self->warn; |
983
|
0
|
|
|
|
|
|
return undef; |
984
|
|
|
|
|
|
|
} |
985
|
|
|
|
|
|
|
|
986
|
0
|
|
|
|
|
|
$self->{config}->{'_'}->{'smallResolution'}=$res; |
987
|
|
|
|
|
|
|
|
988
|
0
|
|
|
|
|
|
$self->writeConfig; |
989
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
990
|
0
|
|
|
|
|
|
$self->warnString('Failed to write the config out'); |
991
|
0
|
|
|
|
|
|
return undef; |
992
|
|
|
|
|
|
|
} |
993
|
|
|
|
|
|
|
|
994
|
0
|
|
|
|
|
|
return 1; |
995
|
|
|
|
|
|
|
} |
996
|
|
|
|
|
|
|
|
997
|
|
|
|
|
|
|
=head2 usable |
998
|
|
|
|
|
|
|
|
999
|
|
|
|
|
|
|
This checks if the this object is usable for rendering or not. |
1000
|
|
|
|
|
|
|
|
1001
|
|
|
|
|
|
|
It does not check if the directories exist, other than the settings are |
1002
|
|
|
|
|
|
|
specified. |
1003
|
|
|
|
|
|
|
|
1004
|
|
|
|
|
|
|
if ( ! $foo->usable ){ |
1005
|
|
|
|
|
|
|
print "This is not a renderable object currently... something is missing...\n"; |
1006
|
|
|
|
|
|
|
} |
1007
|
|
|
|
|
|
|
|
1008
|
|
|
|
|
|
|
=cut |
1009
|
|
|
|
|
|
|
|
1010
|
|
|
|
|
|
|
sub usable{ |
1011
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
1012
|
|
|
|
|
|
|
|
1013
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
1014
|
0
|
|
|
|
|
|
return undef; |
1015
|
|
|
|
|
|
|
} |
1016
|
|
|
|
|
|
|
|
1017
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
1018
|
0
|
|
|
|
|
|
return undef; |
1019
|
|
|
|
|
|
|
} |
1020
|
|
|
|
|
|
|
|
1021
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{outputPath} ) ) { |
1022
|
0
|
|
|
|
|
|
return undef; |
1023
|
|
|
|
|
|
|
} |
1024
|
|
|
|
|
|
|
|
1025
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{outputURL} ) ) { |
1026
|
0
|
|
|
|
|
|
return undef; |
1027
|
|
|
|
|
|
|
} |
1028
|
|
|
|
|
|
|
|
1029
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{srcPath} ) ) { |
1030
|
0
|
|
|
|
|
|
return undef; |
1031
|
|
|
|
|
|
|
} |
1032
|
|
|
|
|
|
|
|
1033
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{srcURL} ) ) { |
1034
|
0
|
|
|
|
|
|
return undef; |
1035
|
|
|
|
|
|
|
} |
1036
|
|
|
|
|
|
|
|
1037
|
0
|
0
|
|
|
|
|
if ( defined( $self->{smallResolution} ) ) { |
1038
|
0
|
0
|
|
|
|
|
if ( $self->{smallResolution} !~ /^[0123456789]*/ ){ |
1039
|
0
|
|
|
|
|
|
return undef; |
1040
|
|
|
|
|
|
|
} |
1041
|
|
|
|
|
|
|
} |
1042
|
|
|
|
|
|
|
|
1043
|
0
|
0
|
|
|
|
|
if ( defined( $self->{largeResolution} ) ) { |
1044
|
0
|
0
|
|
|
|
|
if ( $self->{largeResolution} !~ /^[0123456789]*/ ){ |
1045
|
0
|
|
|
|
|
|
return undef; |
1046
|
|
|
|
|
|
|
} |
1047
|
|
|
|
|
|
|
} |
1048
|
|
|
|
|
|
|
|
1049
|
0
|
|
|
|
|
|
return 1; |
1050
|
|
|
|
|
|
|
} |
1051
|
|
|
|
|
|
|
|
1052
|
|
|
|
|
|
|
=head2 writeConfig |
1053
|
|
|
|
|
|
|
|
1054
|
|
|
|
|
|
|
This writes the config out. |
1055
|
|
|
|
|
|
|
|
1056
|
|
|
|
|
|
|
=cut |
1057
|
|
|
|
|
|
|
|
1058
|
|
|
|
|
|
|
sub writeConfig{ |
1059
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
1060
|
0
|
|
|
|
|
|
my $res=$_[1]; |
1061
|
|
|
|
|
|
|
|
1062
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
1063
|
0
|
|
|
|
|
|
return undef; |
1064
|
|
|
|
|
|
|
} |
1065
|
|
|
|
|
|
|
|
1066
|
0
|
0
|
|
|
|
|
if ( ! defined( $self->{config} ) ){ |
1067
|
0
|
|
|
|
|
|
$self->{error}=4; |
1068
|
0
|
|
|
|
|
|
$self->{errorString}='No config for the current directory'; |
1069
|
0
|
|
|
|
|
|
$self->warn; |
1070
|
0
|
|
|
|
|
|
return undef; |
1071
|
|
|
|
|
|
|
} |
1072
|
|
|
|
|
|
|
|
1073
|
0
|
|
|
|
|
|
my $file=$self->{dir}.'/.toader/gallery.ini'; |
1074
|
0
|
0
|
|
|
|
|
if ( ! $self->{config}->write( $file ) ){ |
1075
|
0
|
|
|
|
|
|
$self->{error}=11; |
1076
|
0
|
|
|
|
|
|
$self->{errorString}='Failed to write the config out to "'.$file.'"'; |
1077
|
0
|
|
|
|
|
|
$self->warn; |
1078
|
0
|
|
|
|
|
|
return undef; |
1079
|
|
|
|
|
|
|
} |
1080
|
|
|
|
|
|
|
|
1081
|
|
|
|
|
|
|
#if VCS is not usable, stop here |
1082
|
0
|
0
|
|
|
|
|
if ( ! $self->{VCSusable} ){ |
1083
|
0
|
|
|
|
|
|
return 1; |
1084
|
|
|
|
|
|
|
} |
1085
|
|
|
|
|
|
|
|
1086
|
|
|
|
|
|
|
#if it is under VCS, we have nothing to do |
1087
|
0
|
|
|
|
|
|
my $underVCS=$self->{vcs}->underVCS($file); |
1088
|
0
|
0
|
|
|
|
|
if ( $self->{vcs}->error ){ |
1089
|
0
|
|
|
|
|
|
$self->{error}=15; |
1090
|
|
|
|
|
|
|
$self->{errorString}='Toader::VCS->underVCS errored. error="'. |
1091
|
0
|
|
|
|
|
|
$self->{vcs}->error.'" errorString="'.$self->{vcs}->errorString.'"'; |
1092
|
0
|
|
|
|
|
|
$self->warn; |
1093
|
0
|
|
|
|
|
|
return undef; |
1094
|
|
|
|
|
|
|
} |
1095
|
0
|
0
|
|
|
|
|
if ( $underVCS ){ |
1096
|
0
|
|
|
|
|
|
return 1; |
1097
|
|
|
|
|
|
|
} |
1098
|
|
|
|
|
|
|
|
1099
|
|
|
|
|
|
|
#add it as if we reach here it is not under VCS and VCS is being used |
1100
|
0
|
|
|
|
|
|
$self->{vcs}->add( $file ); |
1101
|
0
|
0
|
|
|
|
|
if ( $self->{vcs}->error ){ |
1102
|
0
|
|
|
|
|
|
$self->{error}=16; |
1103
|
|
|
|
|
|
|
$self->{errorString}='Toader::VCS->add errored. error="'. |
1104
|
0
|
|
|
|
|
|
$self->{vcs}->error.'" errorString="'.$self->{vcs}->errorString.'"'; |
1105
|
0
|
|
|
|
|
|
$self->warn; |
1106
|
0
|
|
|
|
|
|
return undef; |
1107
|
|
|
|
|
|
|
} |
1108
|
|
|
|
|
|
|
|
1109
|
0
|
|
|
|
|
|
return 1; |
1110
|
|
|
|
|
|
|
} |
1111
|
|
|
|
|
|
|
|
1112
|
|
|
|
|
|
|
=head1 REQUIRED RENDERING METHODS |
1113
|
|
|
|
|
|
|
|
1114
|
|
|
|
|
|
|
The ones listed below are useless and are just included for |
1115
|
|
|
|
|
|
|
compatibility reasons. |
1116
|
|
|
|
|
|
|
|
1117
|
|
|
|
|
|
|
filesDir |
1118
|
|
|
|
|
|
|
renderDir |
1119
|
|
|
|
|
|
|
toDir |
1120
|
|
|
|
|
|
|
|
1121
|
|
|
|
|
|
|
=head2 filesDir |
1122
|
|
|
|
|
|
|
|
1123
|
|
|
|
|
|
|
This returns the file directory for the object. |
1124
|
|
|
|
|
|
|
|
1125
|
|
|
|
|
|
|
This is not a full path, but a partial path that should |
1126
|
|
|
|
|
|
|
be appended the directory current directory being outputted to. |
1127
|
|
|
|
|
|
|
|
1128
|
|
|
|
|
|
|
This returns '' as it is not used by this module. As for rendering, |
1129
|
|
|
|
|
|
|
fullURL is set for L. |
1130
|
|
|
|
|
|
|
|
1131
|
|
|
|
|
|
|
=cut |
1132
|
|
|
|
|
|
|
|
1133
|
|
|
|
|
|
|
sub filesDir{ |
1134
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
1135
|
|
|
|
|
|
|
|
1136
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
1137
|
0
|
|
|
|
|
|
return undef; |
1138
|
|
|
|
|
|
|
} |
1139
|
|
|
|
|
|
|
|
1140
|
0
|
|
|
|
|
|
return ''; |
1141
|
|
|
|
|
|
|
} |
1142
|
|
|
|
|
|
|
|
1143
|
|
|
|
|
|
|
=head2 locationID |
1144
|
|
|
|
|
|
|
|
1145
|
|
|
|
|
|
|
This returns the location ID. |
1146
|
|
|
|
|
|
|
|
1147
|
|
|
|
|
|
|
This one requires the object to be initialized. |
1148
|
|
|
|
|
|
|
|
1149
|
|
|
|
|
|
|
=cut |
1150
|
|
|
|
|
|
|
|
1151
|
|
|
|
|
|
|
sub locationID{ |
1152
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
1153
|
|
|
|
|
|
|
|
1154
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
1155
|
0
|
|
|
|
|
|
return undef; |
1156
|
|
|
|
|
|
|
} |
1157
|
|
|
|
|
|
|
|
1158
|
0
|
|
|
|
|
|
return 'Gallery'; |
1159
|
|
|
|
|
|
|
} |
1160
|
|
|
|
|
|
|
|
1161
|
|
|
|
|
|
|
=head2 renderDir |
1162
|
|
|
|
|
|
|
|
1163
|
|
|
|
|
|
|
This is the directory that it will be rendered to. |
1164
|
|
|
|
|
|
|
|
1165
|
|
|
|
|
|
|
The base directory that will be used for rendering. |
1166
|
|
|
|
|
|
|
|
1167
|
|
|
|
|
|
|
This returns '' as it is not used by this module. As for rendering, |
1168
|
|
|
|
|
|
|
fullURL is set for L. |
1169
|
|
|
|
|
|
|
|
1170
|
|
|
|
|
|
|
=cut |
1171
|
|
|
|
|
|
|
|
1172
|
|
|
|
|
|
|
sub renderDir{ |
1173
|
0
|
|
|
0
|
1
|
|
return ''; |
1174
|
|
|
|
|
|
|
} |
1175
|
|
|
|
|
|
|
|
1176
|
|
|
|
|
|
|
=head2 renderUsing |
1177
|
|
|
|
|
|
|
|
1178
|
|
|
|
|
|
|
This returns the module to use for rendering. |
1179
|
|
|
|
|
|
|
|
1180
|
|
|
|
|
|
|
my $module=$foo->renderUsing; |
1181
|
|
|
|
|
|
|
|
1182
|
|
|
|
|
|
|
=cut |
1183
|
|
|
|
|
|
|
|
1184
|
|
|
|
|
|
|
sub renderUsing{ |
1185
|
0
|
|
|
0
|
1
|
|
return 'Toader::Render::Gallery'; |
1186
|
|
|
|
|
|
|
} |
1187
|
|
|
|
|
|
|
|
1188
|
|
|
|
|
|
|
=head2 toaderRenderable |
1189
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
This method returns true and marks it as being L |
1191
|
|
|
|
|
|
|
renderable. |
1192
|
|
|
|
|
|
|
|
1193
|
|
|
|
|
|
|
=cut |
1194
|
|
|
|
|
|
|
|
1195
|
|
|
|
|
|
|
sub toaderRenderable{ |
1196
|
0
|
|
|
0
|
1
|
|
return 1; |
1197
|
|
|
|
|
|
|
} |
1198
|
|
|
|
|
|
|
|
1199
|
|
|
|
|
|
|
=head2 toDir |
1200
|
|
|
|
|
|
|
|
1201
|
|
|
|
|
|
|
This returns the directory that will return the directory |
1202
|
|
|
|
|
|
|
that contains where this object should be rendered to. |
1203
|
|
|
|
|
|
|
|
1204
|
|
|
|
|
|
|
This is not a full path, but a partial path that should |
1205
|
|
|
|
|
|
|
be appended the directory current directory being outputted to. |
1206
|
|
|
|
|
|
|
|
1207
|
|
|
|
|
|
|
This returns '' as it is not used by this module. As for rendering, |
1208
|
|
|
|
|
|
|
fullURL is set for L. |
1209
|
|
|
|
|
|
|
|
1210
|
|
|
|
|
|
|
=cut |
1211
|
|
|
|
|
|
|
|
1212
|
|
|
|
|
|
|
sub toDir{ |
1213
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
1214
|
|
|
|
|
|
|
|
1215
|
0
|
0
|
|
|
|
|
if (!$self->errorblank){ |
1216
|
0
|
|
|
|
|
|
return undef; |
1217
|
|
|
|
|
|
|
} |
1218
|
|
|
|
|
|
|
|
1219
|
0
|
|
|
|
|
|
return ''; |
1220
|
|
|
|
|
|
|
} |
1221
|
|
|
|
|
|
|
|
1222
|
|
|
|
|
|
|
=head1 ERROR CODES |
1223
|
|
|
|
|
|
|
|
1224
|
|
|
|
|
|
|
=head2 1, noDirSpecified |
1225
|
|
|
|
|
|
|
|
1226
|
|
|
|
|
|
|
No directory specified. |
1227
|
|
|
|
|
|
|
|
1228
|
|
|
|
|
|
|
=head2 2, notAtoaderDir |
1229
|
|
|
|
|
|
|
|
1230
|
|
|
|
|
|
|
The directory is not a Toader directory. |
1231
|
|
|
|
|
|
|
|
1232
|
|
|
|
|
|
|
=head2 3, readConfigFailed |
1233
|
|
|
|
|
|
|
|
1234
|
|
|
|
|
|
|
Failed to read the gallery config. |
1235
|
|
|
|
|
|
|
|
1236
|
|
|
|
|
|
|
=head2 4, noConfig |
1237
|
|
|
|
|
|
|
|
1238
|
|
|
|
|
|
|
No config for this directory. |
1239
|
|
|
|
|
|
|
|
1240
|
|
|
|
|
|
|
=head2 5, nonNumericResolution |
1241
|
|
|
|
|
|
|
|
1242
|
|
|
|
|
|
|
The specified resolution is non-numeric. |
1243
|
|
|
|
|
|
|
|
1244
|
|
|
|
|
|
|
=head2 6, noSrcPath |
1245
|
|
|
|
|
|
|
|
1246
|
|
|
|
|
|
|
No source path specified. |
1247
|
|
|
|
|
|
|
|
1248
|
|
|
|
|
|
|
=head2 7, noSrcURL |
1249
|
|
|
|
|
|
|
|
1250
|
|
|
|
|
|
|
No source URL specified. |
1251
|
|
|
|
|
|
|
|
1252
|
|
|
|
|
|
|
=head2 8, noOutputPath |
1253
|
|
|
|
|
|
|
|
1254
|
|
|
|
|
|
|
No output path specified. |
1255
|
|
|
|
|
|
|
|
1256
|
|
|
|
|
|
|
=head2 9, noOutputURL |
1257
|
|
|
|
|
|
|
|
1258
|
|
|
|
|
|
|
No output URL specified. |
1259
|
|
|
|
|
|
|
|
1260
|
|
|
|
|
|
|
=head2 10, dirAlreadyInit |
1261
|
|
|
|
|
|
|
|
1262
|
|
|
|
|
|
|
The directory has already been initialized. |
1263
|
|
|
|
|
|
|
|
1264
|
|
|
|
|
|
|
=head2 11, pathHelperErrored |
1265
|
|
|
|
|
|
|
|
1266
|
|
|
|
|
|
|
Failed to initialize Toader::pathHelper. |
1267
|
|
|
|
|
|
|
|
1268
|
|
|
|
|
|
|
=head2 12, notAtoaderObj |
1269
|
|
|
|
|
|
|
|
1270
|
|
|
|
|
|
|
Not a Toader object. |
1271
|
|
|
|
|
|
|
|
1272
|
|
|
|
|
|
|
=head2 13, getVCSerrored |
1273
|
|
|
|
|
|
|
|
1274
|
|
|
|
|
|
|
L->getVCS errored. |
1275
|
|
|
|
|
|
|
|
1276
|
|
|
|
|
|
|
=head2 14, VCSusableErrored |
1277
|
|
|
|
|
|
|
|
1278
|
|
|
|
|
|
|
L->usable errored. |
1279
|
|
|
|
|
|
|
|
1280
|
|
|
|
|
|
|
=head2 15, underVCSerrored |
1281
|
|
|
|
|
|
|
|
1282
|
|
|
|
|
|
|
L->underVCS errored. |
1283
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
=head2 16, VCSaddErrored |
1285
|
|
|
|
|
|
|
|
1286
|
|
|
|
|
|
|
L->add errored. |
1287
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
=head2 17, VCSdeleteErrored |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
L->delete errored. |
1291
|
|
|
|
|
|
|
|
1292
|
|
|
|
|
|
|
=head2 18, noToaderObj |
1293
|
|
|
|
|
|
|
|
1294
|
|
|
|
|
|
|
Nothing passed for a L object. |
1295
|
|
|
|
|
|
|
|
1296
|
|
|
|
|
|
|
=head1 AUTHOR |
1297
|
|
|
|
|
|
|
|
1298
|
|
|
|
|
|
|
Zane C. Bowers-Hadley, C<< >> |
1299
|
|
|
|
|
|
|
|
1300
|
|
|
|
|
|
|
=head1 BUGS |
1301
|
|
|
|
|
|
|
|
1302
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
1303
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
1304
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
1305
|
|
|
|
|
|
|
|
1306
|
|
|
|
|
|
|
=head1 SUPPORT |
1307
|
|
|
|
|
|
|
|
1308
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
1309
|
|
|
|
|
|
|
|
1310
|
|
|
|
|
|
|
perldoc Toader::AutoDoc |
1311
|
|
|
|
|
|
|
|
1312
|
|
|
|
|
|
|
|
1313
|
|
|
|
|
|
|
You can also look for information at: |
1314
|
|
|
|
|
|
|
|
1315
|
|
|
|
|
|
|
=over 4 |
1316
|
|
|
|
|
|
|
|
1317
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
1318
|
|
|
|
|
|
|
|
1319
|
|
|
|
|
|
|
L |
1320
|
|
|
|
|
|
|
|
1321
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
1322
|
|
|
|
|
|
|
|
1323
|
|
|
|
|
|
|
L |
1324
|
|
|
|
|
|
|
|
1325
|
|
|
|
|
|
|
=item * CPAN Ratings |
1326
|
|
|
|
|
|
|
|
1327
|
|
|
|
|
|
|
L |
1328
|
|
|
|
|
|
|
|
1329
|
|
|
|
|
|
|
=item * Search CPAN |
1330
|
|
|
|
|
|
|
|
1331
|
|
|
|
|
|
|
L |
1332
|
|
|
|
|
|
|
|
1333
|
|
|
|
|
|
|
=back |
1334
|
|
|
|
|
|
|
|
1335
|
|
|
|
|
|
|
|
1336
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
1337
|
|
|
|
|
|
|
|
1338
|
|
|
|
|
|
|
|
1339
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
1340
|
|
|
|
|
|
|
|
1341
|
|
|
|
|
|
|
Copyright 2011 Zane C. Bowers-Hadley. |
1342
|
|
|
|
|
|
|
|
1343
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
1344
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
1345
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
1346
|
|
|
|
|
|
|
|
1347
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
1348
|
|
|
|
|
|
|
|
1349
|
|
|
|
|
|
|
|
1350
|
|
|
|
|
|
|
=cut |
1351
|
|
|
|
|
|
|
|
1352
|
|
|
|
|
|
|
1; # End of Toader::Gallery |