Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Error displaying PNGs

by pfaut (Priest)
on Mar 15, 2003 at 21:11 UTC ( [id://243349]=note: print w/replies, xml ) Need Help??


in reply to Error displaying PNGs

You need to output HTTP headers indicating a proper Content-Type for a PNG image. Before the binmode, you want something like

print "Content-type: image/x-png\n\n";
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Replies are listed 'Best First'.
Wrong MIME type (was: Error displaying PNGs)
by Aristotle (Chancellor) on Mar 16, 2003 at 01:09 UTC
    The right MIME type is image/png though. All else will result in undefined behaviour, even if some browsers will work.

    Makeshifts last the longest.

      Thanks, Aristotle. I've long since lost my pointer to a list of valid content types. I posted what I last remembered seeing which was likely a long time ago before PNG files were popular.

      --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-19 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found