Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Easy Pixel PNG Generator

by ajt (Prior)
on Oct 11, 2001 at 15:44 UTC ( [id://118194]=note: print w/replies, xml ) Need Help??


in reply to Easy Pixel PNG Generator

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.

Replies are listed 'Best First'.
Re: Re: Easy Pixel PNG Generator
by bladx (Chaplain) on Oct 11, 2001 at 18:25 UTC
    Ok, 3 things:

    I originally had binmode in there ... but took it out after forgetting to keeping it in.

    I used CGI.pm for the parsing ... hmm.

    Yes, I did not use taint checking, I admit it.

    This was just a quick utility based on someone's idea, I have no intention of adding or subracting to it as of this moment, but thanks for the delayed response, ajt.

    Andy Summers

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://118194]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-19 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found