From cefb32fb2ec1447f7d590b90556ce5f669b6ac9f Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 12 Nov 2019 21:52:19 +0100 Subject: [PATCH] dieren: mkimgthumb script to resize images Replaces a previously untracked set of convert rules such as: waterleeuw => '-shave:5%x12%:-chop:20%x0:-flop:-gamma:.8', to postprocess various images, storing this metadata in their file names instead renaming the original waterleeuw.jpg to: waterleeuw:-shave:5%x12%:-chop:20%x0:-flop:-gamma:.8.jpg --- tools/mkimgthumb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 tools/mkimgthumb diff --git a/tools/mkimgthumb b/tools/mkimgthumb new file mode 100755 index 0000000..d7cfa15 --- /dev/null +++ b/tools/mkimgthumb @@ -0,0 +1,13 @@ +#!/usr/bin/env perl +use 5.014; +use warnings; + +for my $src (@ARGV) { + my ($name, @cmds) = split /:/, $src =~ s/\.jpg$//r; + say $name; + unshift @cmds, -gravity => 'northwest'; + push @cmds, -resize => '300x200^', -gravity => 'north', -extent => '300x200'; + push @cmds, '-strip', -quality => '60%'; + system convert => @cmds, $src => "../$name.jpg"; +} + -- 2.30.0