3 if [ -n "`echo "$@
"|grep "\
-help"`" ] ||
[ -n "`echo "$@
"|grep "\
-h"`" ] ||
[ -z "$1" ] ||
[ -z "$2" ]; then
4 echo "imgmini /folder/with/photos/to/minimalization /folder/for/minimalized/photos dpi_pref_600 NOPREF_files_names_without_mini_prefix"
10 echo "Folder with photos dont exist"
18 if [ -n "`echo $3|grep -w '[0-9]\{1,\}'`" ]; then
22 if [ "$4" = "NOPREF" ]; then
28 if [ -n "`ls|grep .jpg`" ];then
29 formaty
="$formaty *.jpg"
32 if [ -n "`ls|grep .JPG`" ];then
33 formaty
="$formaty *.JPG"
36 if [ -n "`ls|grep .png`" ];then
37 formaty
="$formaty *.png"
40 if [ -n "`ls|grep .PNG`" ];then
41 formaty
="$formaty *.PNG"
44 if [ -n "`ls|grep .gif`" ];then
45 formaty
="$formaty *.gif"
48 if [ -n "`ls|grep .GIF`" ];then
49 formaty
="$formaty *.GIF"
52 `ls -1 $formaty>/tmp/imgminimalize-list`
53 `sed -e '/^mini/d' /tmp/imgminimalize-list > /tmp/imgminimalize-listtmp; mv /tmp/imgminimalize-listtmp /tmp/imgminimalize-list`
54 iloscplikow
=`cat /tmp/imgminimalize-list|grep "" -c`
56 while [ $i -le $iloscplikow ]; do
57 orgphoto
=`sed -n "$i p;$i q" /tmp/imgminimalize-list`
58 miniphoto
="$2/$mini$orgphoto"
59 `convert $rozmiar "$orgphoto" "$miniphoto"`
63 `rm /tmp/imgminimalize-list`