From 6eaf259c375a83613907b31437bc4fae005360b4 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 3 May 2020 00:19:30 +0200 Subject: [PATCH] dieren: mkimgthumb test option to override parameters Find files regardless of given :* suffixes, so commands can be executed without having to rename. --- tools/mkimgthumb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/mkimgthumb b/tools/mkimgthumb index 0e9d86e..8875252 100755 --- a/tools/mkimgthumb +++ b/tools/mkimgthumb @@ -5,8 +5,12 @@ use warnings; my $failcount = 0; for my $src (@ARGV) { - my ($name, @cmds) = split /:/, $src =~ s/\.\w+$//r; + my ($name, @cmds) = split /:/, $src =~ s/\.(\w+)\z//r; + my $ext = $1 // '*'; next if $name =~ m/\./; + unless (-e $src) { + ($src) = grep {-e} glob qq<"$name"{,:*}.$ext> or next; + } say $name; unshift @cmds, -gravity => 'northwest'; push @cmds, -resize => '300x200^', -gravity => 'north', -extent => '300x200'; -- 2.30.0