You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
642 B

#!/bin/bash
## Dependencies
# ImageMagick (convert and identify)
# bc
count=0;
(for name in "$@"; do
geometry=$(identify -verbose "$name" | grep geometry | cut -d' ' -f5 | cut -d'+' -f1)
width=`echo $geometry | cut -d'x' -f1`
height=`echo $geometry | cut -d'x' -f2`
if [ $width -gt $height ]; then
resize="512"
else
resize="x512"
fi
convert "$name" -resize $resize "$name.png"
count=$(echo "($count + 1)" | bc)
percent=$(echo " scale=2; ( 100 * ($count/$#))" | bc )
echo "$percent"
done;
) | zenity --progress --percentage=0 --auto-close --text="Making Stickers"