diff options
-rwxr-xr-x | bin/dthumb | 7 | ||||
-rwxr-xr-x | lib/App/Dthumb.pm | 18 |
2 files changed, 18 insertions, 7 deletions
@@ -16,6 +16,7 @@ GetOptions( help|h size|d=i spacing|s=f + no-lightbox|L no-names|n quality|q=i version|v @@ -48,6 +49,12 @@ Note that recursion is not yet supported. =over +=item B<-L>, B<--no-lightbox> + +Disable Javascript lightbox. Note that in the current implementations, this +simple skips installation of the data files. The lightbox link in the HTML +will still be written, leading to 404s on the server. This will be fixed. + =item B<-n>, B<--no-names> Do not show image names below thumbnails diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm index f26848f..ed1ed72 100755 --- a/lib/App/Dthumb.pm +++ b/lib/App/Dthumb.pm @@ -23,6 +23,7 @@ sub new { $conf->{size} //= 200; $conf->{spacing} //= 1.1; $conf->{quality} //= 75; + $conf->{lightbox} = !$conf->{'no-lightbox'}; $conf->{names} = !$conf->{'no-names'}; $ref->{config} = $conf; @@ -104,14 +105,17 @@ sub create_files { mkdir($thumbdir); } - if (not -d $datadir) { - mkdir($datadir); - } + if ($self->{config}->{lightbox}) { + + if (not -d $datadir) { + mkdir($datadir); + } - for my $file (qw(lightbox.js overlay.png loading.gif close.gif)) { - open(my $fh, '>', "${datadir}/${file}"); - print {$fh} $self->{data}->get($file); - close($fh); + for my $file (qw(lightbox.js overlay.png loading.gif close.gif)) { + open(my $fh, '>', "${datadir}/${file}"); + print {$fh} $self->{data}->get($file); + close($fh); + } } } |