X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/139cfe4ebde273208f91d401a2938330faf41c06..256f6aee2a09d51c0350a5c3ed60ba354b115abc:/tools/mkwordthumb?ds=sidebyside diff --git a/tools/mkwordthumb b/tools/mkwordthumb index 2404324..8e7909f 100755 --- a/tools/mkwordthumb +++ b/tools/mkwordthumb @@ -6,7 +6,7 @@ use Shiar_Sheet::ImagePrep; use Shiar_Sheet::DB; use JSON (); -our $VERSION = '1.00'; +our $VERSION = '1.01'; my $db = Shiar_Sheet::DB->connect; my %filter = @ARGV ? (id => shift) : (); @@ -17,6 +17,8 @@ while (my $row = $query->hash) { eval { my $meta = eval { JSON->new->decode($row->{image} // '{}') } or die ["Invalid JSON metadata in image column.", $@]; - $image->convert("data/word/en/$row->{id}.jpg", $meta->{convert}); + my $basename = "data/word/en/$row->{id}"; + $image->convert("$basename.jpg", $meta->{convert}); + $image->convert("$basename.webp", $meta->{convert}, '600x400'); } or warn "$row->{id}: @{$@}"; }