You might have misunderstood me
I really didnt' mean wedge it into the admin.cgi script, but rather that suite of scripts. (I've been working on something that's been keeping me busy, in between the sick kids).
my $new_graphic_file = 'file.ext';
You really want to just do this:
my $new_graphic_file;
and then assign it to the $filename of your uploaded file -- and pass that to the system call as below.
What you want to do is put the html_thumbnail call into a subroutine, and that should go in one of the files, possibly db_utils.pl where it will be included, and callable by the other modules.
You want to pass this subroutine the parameters that it needs:
1) the location of the html_thumbnail program (full unix path)
2) where the image is you want to convert to a thumbnail is located (full unix path + the file name)
3) the output dir - where you want the thumbnail image to go (full unix path)
4) any parameters you want to operate on.
If you look at the code of the html_thumbnail program, it looks for the image in the default directory -- butif you pass it a fully qualified set of paths, it will use those. It does it's own name mangling, you can override it by changing the mangling procedure in the program.
I really should have sat down and typed this all out, but I've been really overworked this week.
----------
my $htmlthumbnail_script ='/full/path/to/htmlthumbnail'; # a parameter to set
my $working_dir = '/filepath/at/some/location'; # another parameter to set -- where your file is located
my $thumbnail_dir; # where you want the thumbnail to go
my $new_graphic_file; # the variable to hold the file you are going to modify
chdir $working_directory; ## move to the working directory, logically.
## then invoke the html_thumbnail program to operate on the $new_graphic_file
## and put the thumbnail in the output directory you specify with the parameter
## [-catalogdir <sub-directory-name-for-icons>]
system($htmlthumbnail_script,'-update',$index_file,
'-output',$index_file,
'-link',1,
'-catalogdir', $thumbnail_dir,
$new_graphic_file);