From 866439d781c55a0fb1a0b3b7a92b7783a7a5dfc8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 3 Mar 2011 21:24:01 +0100 Subject: Add -r/--recreate option --- Changelog | 2 +- bin/dthumb | 10 +++++++--- lib/App/Dthumb.pm | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Changelog b/Changelog index ea5e415..08580e4 100644 --- a/Changelog +++ b/Changelog @@ -1,9 +1,9 @@ git HEAD * Add progressbar, introduces new dependency Time::Progress - * Switch from lightbox to shadowbox * Show filename in lightbox * The HTML title is now configurable, it defaults to the current directory + * Add -r/--recreate option to recreate all thumbnails dthumb 0.1 - Sun Feb 27 2011 diff --git a/bin/dthumb b/bin/dthumb index c39280a..05ea6fc 100755 --- a/bin/dthumb +++ b/bin/dthumb @@ -24,6 +24,7 @@ GetOptions( no-lightbox|L no-names|n quality|q=i + recreate|r size|d=i spacing|s=f title|t=s @@ -110,6 +111,10 @@ will still be written, leading to 404s on the server. This will be fixed. Do not show image names below thumbnails +=item B<-r>, B<--recreate> + +Recreate all thumbnails + =item B<-d>, B<--size> I Maximum thumbnail size (either width or height). Defaults to 200 @@ -177,9 +182,8 @@ Ehttp://github.com/derf/dthumb/issuesE. Copyright (C) 2009-2011 by Daniel Friesel Ederf@chaosdorf.deE. -The shadowbox code is (C) 2007-2010 by Michael J. I. Jackson. See -Ehttp://www.shadowbox-js.com/E and especially -Ehttp://www.shadowbox-js.com/LICENSEE. +The lightbox code is (C) by Lokesh Dhakar +. =head1 LICENSE diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm index 941a70d..7f9bb23 100755 --- a/lib/App/Dthumb.pm +++ b/lib/App/Dthumb.pm @@ -114,9 +114,10 @@ sub new { my ($obj, %conf) = @_; my $ref = {}; + $conf{quality} //= 75; + $conf{recreate} //= 0; $conf{size} //= 200; $conf{spacing} //= 1.1; - $conf{quality} //= 75; $conf{title} //= (split(qr{/}, cwd()))[-1]; $conf{file_index} //= 'index.xhtml'; $conf{dir_thumbs} //= '.thumbs'; @@ -305,7 +306,7 @@ sub create_thumbnail_image { my $thumbdir = $self->{config}->{dir_thumbs}; my $thumb_dim = $self->{config}->{size}; - if (-e "${thumbdir}/${file}") { + if (-e "${thumbdir}/${file}" and not $self->{config}->{recreate}) { return; } -- cgit v1.2.3