dl14
Junior Member
Posts: 22
|
Post by dl14 on Jan 14, 2017 9:02:56 GMT -8
Hello,
I have made an image converting shell script that takes screenshots from a mac and converts the .png to a .jpg that's compatible with the Gameduino2.. let me know what you guys think and if there's any way to make it more convenient!
Note: the naming convention I use is for a specific project of mine
read -p "Chapter number? " CH read -p "Verse number? " NUM newNum=$NUM # add a leading 0 if it's a 1 digit # if [ $CH -lt 10 ] ; then newCH="0$CH" else newCH="$CH" fi
for FILES in *.png do # name format is: "Ch##_##.jpg" for my project # change here for different name if [ $NUM -lt 10 ] ; then FILENAME="Ch${newCH}_0${NUM}.jpg" else FILENAME="Ch${newCH}_${NUM}.jpg" fi echo "$FILES" sips -s format jpeg "$FILES" --out "$FILENAME" sips -z 210 479 $FILENAME convert -sampling-factor 4:2:0 $FILENAME let NUM=($NUM+1) done
rm *.png
|
|