From fbb20ada6aac2494df288d8bcbb81921756f7696 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 23 Apr 2025 13:29:36 +1000 Subject: [PATCH] boards/update-thumb.sh: Create thumbnails for JPG and PNG images. Signed-off-by: Damien George --- boards/.gitignore | 1 + boards/update-thumb.sh | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/boards/.gitignore b/boards/.gitignore index 1db0632..f82392a 100644 --- a/boards/.gitignore +++ b/boards/.gitignore @@ -1 +1,2 @@ */*.thumb.jpg +*/*.thumb.png diff --git a/boards/update-thumb.sh b/boards/update-thumb.sh index 6f7782d..35dd4b2 100755 --- a/boards/update-thumb.sh +++ b/boards/update-thumb.sh @@ -1,3 +1,13 @@ #!/bin/bash -rm */*.thumb.jpg -for file in */*; do convert $file -thumbnail 300 ${file/.jpg/.thumb.jpg}; done + +function update_thumb { + ext=$1 + rm */*.thumb.$ext + for file in */*.$ext; do + echo "Processing $file" + convert $file -thumbnail 300 ${file/.$ext/.thumb.$ext} + done +} + +update_thumb jpg +update_thumb png