in reply to Adding directory to code
As it stands, the code is reading a full-image file from whatever path is provided in the "FILE$a" parameters, and copying it to the directory specified by "$ENV{DOCUMENT_ROOT}", which is the value being assigned to $Photo_Dir.
Let's assume that a thumbnail file ends up being one of the "FILE$a" parameters. If you declare a variable like "$Thumb_Dir", with a suitable value, and figure out how to identify an input thumbnail file, you'll probably end up altering the "open(OUTFILE...)" line a bit and adding one extra instruction just before that, something like the following:
... my $filename = ( $full_image ) ? "$Photo_Dir/$filename" : "$Thumb_dir/th_$filename"; if(open(OUTFILE, ">$filename")) { while (my $bytesread = read($file, my $buffer, 1024)) { print OUTFILE $buffer; } close (OUTFILE); ...
P.S.: Lighten up on merlyn. What he said was true -- you were presenting code written by someone else (though not all of it -- you missed a closing curly brace), and you did not state the problem clearly enough for anyone to give you a solid answer (that's why my response had so many questions in it.) It's both entirely possible and fully correct to interpret his response as meaning no personal offense. (For that matter, considering the amount of redundant and/or unnecessary code in this script, saying that someone else must have written it could have be taken as a compliment...)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Adding directory to code
by cal (Beadle) on Nov 04, 2002 at 04:39 UTC | |
by graff (Chancellor) on Nov 04, 2002 at 07:05 UTC |