summaryrefslogtreecommitdiff
path: root/bin/dthumb
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dthumb')
-rwxr-xr-xbin/dthumb30
1 files changed, 29 insertions, 1 deletions
diff --git a/bin/dthumb b/bin/dthumb
index 64c527a..ced3a78 100755
--- a/bin/dthumb
+++ b/bin/dthumb
@@ -8,8 +8,13 @@ use autodie;
use App::Dthumb;
use Getopt::Long qw(:config no_ignore_case);
+use IO::Handle;
+use Time::Progress;
+
+STDERR->autoflush(1);
my $opt = {};
+my $id = 1;
GetOptions(
$opt,
@@ -25,8 +30,31 @@ GetOptions(
) or die("Please see perldoc -F $0\n");
my $dthumb = App::Dthumb->new($opt);
+my $timer = Time::Progress->new();
+
+
+$dthumb->check_cmd_flags();
+$dthumb->read_directories();
+$dthumb->create_files();
+$dthumb->delete_old_thumbnails();
+
+$timer->attr(
+ min => 1,
+ max => scalar $dthumb->get_files(),
+);
+
+for my $file ($dthumb->get_files()) {
+ print STDERR $timer->report(
+ "\r\e[KCreating Thumbnails: %p done, %L elapsed, %E remaining",
+ $id++,
+ );
+
+ $dthumb->create_thumbnail_html($file);
+ $dthumb->create_thumbnail_image($file);
+}
+print "\n";
-$dthumb->run();
+$dthumb->write_out_html();
__END__