Err, this doesn't actually work! For those of us forced to labour under a Microsoft cloud, you can't just print binary files out without turning binmode on. Thus you need to change the print statement at the end to:
open IMAGE, ">" . $name . ".png";
binmode IMAGE;
print IMAGE $im->png();
close IMAGE;
You have also loaded CGI but then gone on to print out your own HTML. It seems a bit much having a dog, and barking yourself, if you ask me.
Also sin of sins, you are writing to the file system, with a user supplied filename and not doing any taint checking. I know you said this was a "simple utility", but you should not allow anyone to write to your filesystem, without being sure that they are writing what and where you want to allow them. See perlsec.
I think merlyn wrote a pixel factory on his column, which is similar in idea.
Your script is however, minor defects aside, quite useful.
|