#! /usr/bin/perl
system("mkdir thumbs");
system("mkdir features");
(@images)=qx (ls *.jpg);

foreach $_ (@images) {


#$infile = "/tmp/images.txt";
#open(INFILE,"$infile")  || die "can't open $infile \n";

#while (<INFILE>) {
#    print "$_";
    
    if(m|(.*)|) { 
        $fullimg = $1;
    }
    $i++;
    print "convert -depth 8 -resize 90x90 '$fullimg' 'thumbs/$fullimg'";
	    
    system ("convert -depth 8 -quality 90 -size 90x90 -resize 90x90 '$fullimg' 'thumbs/$fullimg'")==0;	
    print "convert -depth 8 -resize 300x110 '$fullimg' 'thumbs/$fullimg'";
	    
    system ("convert -depth 8 -quality 75 -size 160x300 -resize 160x300 '$fullimg' 'features/$fullimg'")==0;	
	        #system("cp tmp/* .")==0; 

    $thissize ="-s thumbs/$fullimg";	
    print "thumbs/$fullimg - $thissize\n";        
}        



print "\n\nFini.\n";
