#!/usr/bin/perl
#
# Make 1/3 size copies of all images in the current directory
#   Place copies into a subdir with _small added to the their name.
#
# MWR 7/6/2007

$debug = 1;

#@files = glob("PICT0001.JPG");
@files = glob("PICT*JPG");
foreach $file (@files) {

  if ($debug > 0) {
    printf " next file is ..%s.. \n", $file;
  }

  $name = $file;
  $name =~ s/\.JPG/_small\.JPG/;
  $name = "./onethird/$name";
  if ($debug > 0) {
    printf " new name is ..%s.. \n", $name;
  }
  
  $cmd = "convert -geometry 33%x33% $file $name ";
  if ($debug > 0) {
    printf " cmd is ..%s.. \n", $cmd;
  }
  $ret = `$cmd`;
  

}


exit 0;
