diff -urN saku-3.6.1/shingetsu/thread_cgi.py saku-3.6.1-img/shingetsu/thread_cgi.py --- saku-3.6.1/shingetsu/thread_cgi.py 2008-10-19 15:34:37.000000000 +0900 +++ saku-3.6.1-img/shingetsu/thread_cgi.py 2009-12-13 21:44:39.000000000 +0900 @@ -32,6 +32,7 @@ import mimetypes import re import time +import imghdr from Cookie import SimpleCookie from compatible import md5 @@ -290,9 +291,13 @@ self.stdout.write( "Content-Type: " + type + "\n" + "Last-Modified: " + self.rfc822_time(stamp) + "\n" + - "Content-Length: " + str(rec.attach_size()) + "\n" + - "Content-Disposition: attachment\n" + - "\n") + "Content-Length: " + str(rec.attach_size()) + "\n") + if imghdr.what(attach_file) is not None: + #self.stderr.write("print file image type: %s\n" % imghdr.what(attach_file)) + pass + else: + self.stdout.write("Content-Disposition: attachment\n") + self.stdout.write("\n") try: f = file(attach_file, "rb") buf = f.read(1024)