Hi,
I am trying to convert a folder of tif files to jpeg so they can be displayed on my website. my current approach is not working. i wrote a perl script with
#!/usr/bin/perl
opendir(DIR, $ARGV[0]);
@files = readdir(DIR);
closedir(DIR);
foreach $file (@files){
if($file =~ /(.*?)\.tif/){
print "converting $file\n";
`convert -auto-level -depth 12 -type grayscale $ARGV[0]$file $ARGV[1]$1.jpg`;
}
}
But this never enters the for loop because the opendir fails. The folder does exist.
i am calling this by exec("perl test.pl arg1 arg2"); in php
Is this how i should be doing this because it isn't working?
Also i gave pretty much everything that needs to be accessed or written to chmod 777
thanks