8 my ($name, @cmds) = split /:(?<!\\:)/, $src =~ s/\.(\w+)\z//r;
10 next if $name =~ m/\./;
12 ($src) = grep {-e} glob qq<"$name"{,:*}.$ext> or next;
14 s/\\(.)/$1/g for @cmds;
17 if (@cmds and $cmds[0] =~ /^\d/) {
18 # crop shorthand from initial dimension argument
19 my @crop = split /\D/, shift @cmds;
20 unshift @cmds, -gravity => 'southeast', -chop => "$crop[2]%x$crop[3]%"
22 unshift @cmds, -chop => "$crop[0]%x$crop[1]%";
24 unshift @cmds, -gravity => 'northwest' if @cmds;
25 push @cmds, -resize => '300x200^', -gravity => 'north', -extent => '300x200';
26 push @cmds, '-strip', -quality => '60%';
27 system(convert => @cmds, $src => "../$name.jpg") == 0
28 or $failcount += warn "error creating $name.jpg from $src\n";