diff -urN saku-3.6.1/file/sample.ini saku-3.6.1-img/file/sample.ini --- saku-3.6.1/file/sample.ini 2007-10-06 21:37:14.000000000 +0900 +++ saku-3.6.1-img/file/sample.ini 2009-12-13 21:12:19.000000000 +0900 @@ -119,3 +119,9 @@ # Page size for mobile mobile_page_size: 10 + +# no download attach file +images: jpeg + png + gif + bmp diff -urN saku-3.6.1/shingetsu/config.py saku-3.6.1-img/shingetsu/config.py --- saku-3.6.1/shingetsu/config.py 2009-03-01 19:10:27.000000000 +0900 +++ saku-3.6.1-img/shingetsu/config.py 2009-12-13 21:14:42.000000000 +0900 @@ -132,6 +132,8 @@ 'Application Thread', 'mobile_page_size', 10, 'int') +images = _get_value(_extconf, 'Application Thread', 'images', '') + client_cycle = 5*60 # Seconds; Access client.cgi ping_cycle = 5*60 # Seconds; Check nodes sync_cycle = 5*60*60 # Seconds; Check cache 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:33:26.000000000 +0900 @@ -32,6 +32,7 @@ import mimetypes import re import time +import imghdr from Cookie import SimpleCookie from compatible import md5 @@ -286,13 +287,19 @@ self.print404(cache) return attach_file = rec.attach_path() + if 'jpg' in config.images: + config.images.append('jpeg') if attach_file is not None: 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) in config.images: + #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)