CGI to make PNG image

Andre van Straaten andre at UltraShell.Net
Thu Aug 17 14:39:26 EDT 2000


effbot at pythonware.com wrote:
> Andre van Straaten wrote:
>> MSIE can't read png images at all

> not true.  MSIE has provided basic PNG support
> since the first 4.0 betas.

Well, the MSIE 5.0 which I use at work doesn't show the image and pops up a box instead to save
the file.

As I don't use MS products at home, I had no problems with Netscape 4.7 when I uploaded the
fetchmail.png file from
http://www.tuxedo.org/~esr/fetchmail/

onto my homepage.
When I saw later that MSIE5.0 doesn't show it, and I read something about the acceptance of png
images, I converted the png file into a gif file.

Somehow I damaged thereby or later the original png file.
(Thanks to Michael Stroeder who mailed me that fault.)
Sorry about that, but I have now uploaded a new png file.

Finally, for exact information which browsers support png files, I recommend a qualified Web
search.

-- avs

> Take Sato wrote:
>> I made a simple CGI script to return images on WinNT
>> with Apache1.3.12.
>>
>> > import Image
>> > try:
>> >     import msvcrt,os  #set standard output to binary mode
>> >     msvcrt.setmode(sys.stdout.fileno(),os.O_BINARY)
>> > except: pass

> not sure what's causing this, but you could try running
> the python interpreter with the -u option (binary mode,
> no buffering).

> :::

> if that doesn't help, try saving to a StringIO object:

>     outfile = StringIO.String()
>     image.save(outfile, "png")
>     print outfile.getvalue()

> </F>


> Sent via Deja.com http://www.deja.com/
> Before you buy.

-- 

Andre van Straaten
http://www.vanstraatensoft.com
______________________________________________
flames please to /dev/null at vanstraatensoft.com






More information about the Python-list mailing list