Etope-O-Mat.sh
- Read more about Etope-O-Mat.sh
- Log in to post comments
#!/bin/bash
# get image name
if [ -z $1 ]; then
# read from dialog
INPUT=$(zenity --title "Etope-O-Mat" --entry --text "Bildname:")
else
# copy input from command line
INPUT=$@
fi
for IMAGE in $INPUT; do
# convert image name to lower case
IMAGE=$(echo ${IMAGE} | tr "[:upper:]" "[:lower:]")
# add .jpg file extension if not already exists
IMAGE="${IMAGE/.jpg}.jpg"
# set input and output
PATH_IN=/media/bilder/300dpi
PATH_OUT=/home/$USER/200px
FILE_IN="${PATH_IN}/${IMAGE}"
FILE_OUT="${PATH_OUT}/${IMAGE}"
# check dirs
[ !