in reply to CGI script bringing its own data
be available automagically when the script starts.my $image = GD::Image->newFromPngData($data, 1);
There are several ways to do that:
I haven't tried it myself, but I fear that you'll not be able to freeze the GD::Image object (because it is most likely a complex object, not a simple hash ref), so you would have to freeze $data. But that's just the contents of the file, so that doesn't make much sense.
You can however speed up the reading of the original PNG file:
open (my $in_fh, $infile) or die; local $/; # enable slurping mode my $data = <$in_fh>; close $in_fh;
Hope this helps.
Liz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: CGI script bringing its own data
by hacmac (Novice) on Sep 03, 2003 at 10:31 UTC | |
by liz (Monsignor) on Sep 03, 2003 at 10:56 UTC |