diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-02-22 20:21:28 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-02-22 20:21:28 +0100 |
commit | 7fad3f17eb256fb25402fe4a4481a4b077502594 (patch) | |
tree | 09b44066445b9263d245a86972e75598d13a3db3 /bin | |
parent | 4af9fa661234fbcfc92b4e39cdb7c7a6f57a2ba6 (diff) |
Remove thumbnails of deleted images
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/dthumb | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -63,6 +63,20 @@ while (my $line = <DATA>) { } close($lightbox); +if (-d $thumbdir) { + opendir(my $thumb_dh, $thumbdir); + for my $file (readdir($thumb_dh)) { + if ($file =~ qr{^\.}) { + next; + } + + if (not -e $file) { + unlink("${thumbdir}/${file}"); + } + } + closedir($thumb_dh); +} + open(my $index, '>', $file_index); print $index <<"EOD"; @@ -311,8 +325,7 @@ None. =head1 BUGS AND LIMITATIONS -There is no detection for changed images, the thumbnails of deleted images are -not removed. +Thumbnails of changed images are not yet recreated. When used with B<-x>, the completer tar archive is kept in memory, leading to enormous memory usage and possibly out-of-memory errors. |