I am trying to find fractions of an image size using this
w=$(identify -format "%w" $1)
h=$(identify -format "%h" $1)
w16=$(($w/16))
w2=$(($w/2))
h16=$(($h/16))
h2=$(($h/2))
which returns this error
identify: unable to open image `1323728291642.jpg': ��� @ error/blob.c/OpenBlob/2489.
identify: unable to open image `1323728291642.jpg': @ error/blob.c/OpenBlob/2489.
identify: unable to open image `1323728291642.jpg': �8� @ error/blob.c/OpenBlob/2489.
identify: unable to open image `1323728291642.jpg': @ error/blob.c/OpenBlob/2489.
bash: /16: syntax error: operand expected (error token is "/16")
it was being used in this context
for i in `cat ../list`; do . ~/base64ensize.sh "$i" jpg|gpaste add;read -p "Press [Enter] key to start backup..."; done
list was a list of image files in the current directory
if needed here is the rest of base64ensize.sh
w=$(identify -format "%w" $1)
h=$(identify -format "%h" $1)
w16=$(($w/16))
w2=$(($w/2))
h16=$(($h/16))
h2=$(($h/2))
#echo $w $w2 $w15 $h $h2 $h16
echo -n "<img height='$h16' width='$w16' onclick="
echo -n '"this.height='
echo -n "'$h2';this.width='$w2'"
echo -n '" ondblclick="this.height='
echo -n "'$h16';this.width='$w16'"
echo -n '"'
echo -e "src='data:image/EXT;base64,"$(base64 $1)"'>" >> temp
sed s/"EXT"/$2/ temp
rm temp
base64ensize.sh:
you may want to put the for loop into run.sh and then generte your html by: