#!/bin/bash
for folder in www/img/*; do
	if [[ -d $folder ]]; then
		for file in $folder/*; do
			if [[ -f $file ]]; then
				echo $file;
				for i in {1..32}; do
					if [ -d $folder/x$i ]; then
						d=$((i*33))
						convert "$file" -resize ${d}x${d}  $folder/x$i/${file:${#folder}+1:100}
					fi
				done
			fi
		done
	fi
done;

#for file in *.jpg;do
#    convert "$file" -resize 800x800  "view/$file"
#    convert "$file" -resize 600x600  "preview/$file"
#    convert "$file" -resize 340x340  "miniature/$file"
#    convert "$file" -resize 180x180  "thumb/$file"
#done

