- unshift @cmds, -gravity => 'northwest' if @cmds;
- push @cmds, '-strip', -gravity => 'north', -quality => 60;
- my @cmdwebp = (-resize => '630x420^', -extent => '630x420', -quality => 30);
- my @cmdjpeg = (-resize => '300x200^', -extent => '300x200');
- system(convert => $src, @cmds, @cmdjpeg, "../$name.jpg" ) == 0 and
- system(convert => $src, @cmds, @cmdwebp, "../$name.webp") == 0
- or $failcount += warn "error creating $name.jpg from $src\n";
+ push @cmds, -gravity => 'north';
+ eval {
+ my $image = Shiar_Sheet::ImagePrep->new($src);
+ for (@ffs) {
+ my ($ff, @ffcmds) = @{$_};
+ print " $ff";
+ $image->convert("$target/$name.$ff", [@cmds, @ffcmds]);
+ }
+ 1;
+ } or do {
+ say ' FAILED';
+ warn ref $@ eq 'ARRAY' ? $@->[1] : $@ if $@;
+ $failcount++;
+ };
+}
+continue {
+ say '';