[Zope] Mime type for PNG

Chris McDonough chrism@digicool.com
Sat, 13 Nov 1999 16:31:04 -0500


Bruce Elrick wrote:
> 
> I'm using Zope 2.0.1 from source, Python 1.5.2 from Redhat 6.1, IBM's Apache
> based web server, rewrite rules:
> RewriteEngine On
> RewriteLog logs/rewrite_log
> RewriteLogLevel 0
> RewriteCond %{HTTP:Authorization} ^(.*)
> RewriteRule ^/Zope(.*) /opt/IBMHTTPServer/cgi-bin/Zope.cgi$1
> [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]
> 
> Here is a duplication of your experiment:
> 
<snip>

I compiled a clean copy of Apache 1.3.9 and backed it with the stock
stable release of Zope 2.0.1 via PCGI and my experiment shows:

[mcdonc@cindy mcdonc]$ telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
HEAD /Zope/goopy_png HTTP/1.0

HTTP/1.1 200 OK
Date: Sat, 13 Nov 1999 21:11:47 GMT
Server: Apache/1.3.9 (Unix)
Connection: close
Ms-Author-Via: DAV
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
Content-Length: 1338
Last-Modified: Sat, 13 Nov 1999 21:10:15 GMT
Content-Type: image/png

> For your digestion, I'll also include (from the Zope directory):
> # find . -name '*.py' -exec grep -i png {} \; -print
>     """Image objects can be GIF, PNG or JPEG and have the same methods
>         # handle PNGs
>         # Re: PNG v1.2 spec (http://www.cdrom.com/pub/png/spec/)
>         elif (size >= 24) and (data[:8] == '\211PNG\r\n\032\n') \
>         # Maybe this is for an older PNG version.
>         elif (size >= 16) and (data[:8] == '\x89PNG\r\n\x1a\n'):
> ./OFS/Image.py
>             'image/x-png':     'PNG Image',
> ./Products/Confera/FileObject.py
>             'image/x-png':     'PNG Image',
> ./Products/Squishdot/Squishfile.py
> 
<snip>
> So, is the Confera code 'polluting' the PNG Mime type waters?

Hmmmm.... I'm the new guy.  So I don't know.  Maybe.  When I do a rgrep
on the code that comes with stock 2.0.1, x-png doesn't show up
anywhere.  The PNG object you've uploaded, it's just a straight Image
class (e.g. did you use the web interface to upload a graphic?), or have
you defined a custom class of some type for the object?  If it's just a
regular Image class, what does the web interface show as its "Content
Type" through the management screen?

HTH,

-- 
Chris McDonough
Digital Creations, Inc.
Zope - http://www.zope.org