my $img = Image::Magick->new(); $img->Read(file => "orig/$path/$base.$ext") and die "Can't read in the image: $!"; $img->Write(file => "target/$path/$base.jpg");