#!/usr/bin/perl $ENV{HTTPS} = "on"; use localbucky; $dbh = DBI->connect ($dsn); my $doit_id = $ARGV[0]; if (length($doit_id)) { my $thread = get_thread($doit_id); check_and_render($thread); } else { my $threads = get_threads(); foreach my $t (@$threads) { check_and_render($t); } } sub check_and_render { my ($t) = @_; my $path = qq($data_path/$t->{id}/.thumb); my $printed = 0; my $files = get_files($t->{id}); foreach $f (@$files) { next unless ($f->{filename} =~ /(gif|jpe?g|png)$/i); next unless (-e "$data_path/$f->{parent_id}/$f->{filename}"); system($RM_PATH, "-f", "$path/t.".(lc($f->{filename}))); if (! $printed) { print qq(Generating thumbs for $t->{id} -- $t->{title}\n); $printed++; } print "$f->{filename} "; make_image_thumb({ file => $f, maxwidth => 145, maxheight => 110, key => $THUMB_LIBRARY_PREFIX }); } print qq(\n\n) if ($printed); } # system("chown", "-R", "carbon:psacln", "$data_path"); $dbh->disconnect();