From 10e74a641a08e9ce7dc38e7ef7a85cac6584fa8f Mon Sep 17 00:00:00 2001 From: Alexandre Dupas Date: Sun, 12 Jul 2009 21:24:12 +0200 Subject: [PATCH] Add a small script that resize covers. --- utils/resize-cover.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 utils/resize-cover.sh diff --git a/utils/resize-cover.sh b/utils/resize-cover.sh new file mode 100755 index 00000000..d94e13d2 --- /dev/null +++ b/utils/resize-cover.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# Resize image if needed + +for image in songs/*/*.jpg songs/*/*.png ; +do + SIZE=`identify $image | awk '{ print $3}' | sed 's/x/ /'`; + XSIZE=`echo $SIZE | awk '{ print $1}'`; + YSIZE=`echo $SIZE | awk '{ print $2}'`; + + if [ $((XSIZE)) -gt 128 ] + then + convert $image -resize 128x128 $image; + elif [ $((YSIZE)) -gt 128 ] + then + convert $image -resize 128x128 $image; + fi +done; \ No newline at end of file