[magick-users] perlmagic -- problem with write being buffered?
Robert W Weaver
woody.weaver at us.ibm.com
Wed Nov 21 14:21:39 PST 2007
greetings, ImageMagicians,
I've got a problem that appears to be a buffer flushing issue.
My goal is to pull a blob out of a database, scribble on it, write it to
a temporary file, and then embed that temporary file in an excel page
(via OLE).
I have a routine &buildGraphic that returns a temporary file name. If I
arrange for the file not to be deleted and look at it after a run, it
looks fine.
After calling &buildGraphic, I've a routine &loadGraphicIntoSheet that
is passed that temporary file name. Inside that, I do some OLE magic,
and have a line
$worksheet->Shapes->AddPicture($tempGraphic, 1, 1, 0, 0, int($width *
3/4 + 0.5), int($height * 3/4 + 0.5));
This fails with a "The specified file wasn't found" error.
If instead of soft-coding, I hard code the output from the previous run,
all is well; that is, if I hard code
$tempGraphic = 'C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\eVRiTDAfB7.png';
before the line to execute, it works fine.
Curiously, executing in buildGraphic
$rv = $image->Write($filename); # write out temp file
print `ls -l $filename`; # debugging
yields something nominal:
-rwxrwxrwx 1 rwweaver None 82674 Nov 21 16:53
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\eVRiTDAfB7.png
Is there a way to force imagemagick to flush output and release the file
handle?
--woody
--
woody weaver 7301 hilltop ct
301 524 8128 frederick, MD
More information about the Magick-users
mailing list