@file = `ls *jpg`;

foreach $filename (@file)
{
   chomp($filename);
   `convert $filename -resize 50% tmp/$filename`
}

