Perl. Using variables in the $image->Read('$tif_to_gif');
Posted: 2007-11-20T07:56:47-07:00
Hi all,
I am trying to write a Perl script that reads in the graphic name as a variable and converts it from a tif to a gif.
A varied amount of graphics are uploaded into a directory on a daily basis that the script will auto process on.
Image magic works when I have the actual file name but will not work with the variables.
Am I doing this wrong or is it not possible to use image magic this way?
I have pasted my code below:
my $file = 12345678.tif;
my $file_1 = 12345678;
my $tif_to_gif = "/MartinR/graf-autoproc/$file";
my $gif_conversion = "/MartinR/gif/$file_1.gif";
my $x = $image->Read('$tif_to_gif');
$x = $image->Set(magick => 'GIF');
$x = $image->Write('$gif_conversion');
exit();
thanking you in anticipation
Martin
I am trying to write a Perl script that reads in the graphic name as a variable and converts it from a tif to a gif.
A varied amount of graphics are uploaded into a directory on a daily basis that the script will auto process on.
Image magic works when I have the actual file name but will not work with the variables.
Am I doing this wrong or is it not possible to use image magic this way?
I have pasted my code below:
my $file = 12345678.tif;
my $file_1 = 12345678;
my $tif_to_gif = "/MartinR/graf-autoproc/$file";
my $gif_conversion = "/MartinR/gif/$file_1.gif";
my $x = $image->Read('$tif_to_gif');
$x = $image->Set(magick => 'GIF');
$x = $image->Write('$gif_conversion');
exit();
thanking you in anticipation
Martin