Opened 13 years ago
Closed 13 years ago
#10302 closed defect (duplicate)
Trac Attachments image break sometime
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | lowest | Milestone: | |
Component: | general | Version: | 0.12-stable |
Severity: | minor | Keywords: | needinfo |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Sometime trac can't display image correctly, Only ¼ or ½ image appear, and other part is blank!
I using Firefox Opera Chrome, and this issue still appear.
But after I using apache mod_rewrite, this issus gone. Below is my apache httpd.conf
WSGIScriptAlias /trac "D:/Apache/trachome/loader.wsgi.py" <Location /trac> WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Location> RewriteEngine on #Let apache handle static file RewriteRule /trac/([^/]*)/chrome/common/(.*) "C:/Python25/Lib/site-packages/trac-0.12.2-py2.5.egg/trac/htdocs/$2" #Let apache handle raw attachments RewriteRule /trac/([^/]*)/raw-attachment/wiki/(.*) "D:/Apache/trachome/$1/attachments/wiki/$2"
I don't know why, anyone can check this? I using windows xp sp3, apache2.2.11, python2.5.4, mod_wsgi2.0. Thanks.
Attachments (1)
Change History (10)
follow-ups: 2 3 comment:1 by , 13 years ago
Keywords: | needinfo added |
---|
comment:2 by , 13 years ago
Replying to rblank:
Is there anything in your Trac or Apache log that could give us a hint about the issue?
Ok, I will enable log and check it. Thanks.
comment:3 by , 13 years ago
Replying to rblank:
Is there anything in your Trac or Apache log that could give us a hint about the issue?
I enable apache log and trac log. When using mod_rewrite, apache log is
127.0.0.1 - - [05/Aug/2011:16:56:11 +0800] "GET /trac/project/raw-attachment/wiki/xxx/6309fc78gw1djni1pak5sj.jpg HTTP/1.1" 200 119947
When disable mod)rewrite, apache log is
127.0.0.1 - - [05/Aug/2011:16:58:00 +0800] "GET /trac/project/raw-attachment/wiki/xxx/6309fc78gw1djni1pak5sj.jpg HTTP/1.1" 200 94208
It appear that just 94208 transfer! But actual file size is 119947 bytes(So transfer right when use mod_rewrite)!
comment:4 by , 13 years ago
And this patch work fine.
-
attachment.py
754 754 if 'charset=' not in mime_type: 755 755 charset = mimeview.get_charset(str_data, mime_type) 756 756 mime_type = mime_type + '; charset=' + charset 757 req.send_file(attachment.path, mime_type) 757 #req.send_file(attachment.path, mime_type) 758 filedata = fd.read() 759 req.send_header('Content-Type', mime_type) 760 req.send_header('Content-Length', fd.tell()) 761 req.end_headers() 762 req.write(filedata) 758 763 759 764 # add ''Plain Text'' alternate link if needed 760 765 if (self.render_unsafe_content and
follow-up: 6 comment:5 by , 13 years ago
Looks like this is mod-wsgi-issue:100. Can you please try to upgrade?
comment:6 by , 13 years ago
Replying to cboos:
Looks like this is mod-wsgi-issue:100. Can you please try to upgrade?
Thanke, now, I upgrade to mod_wsgi-3.3, issue still.
follow-up: 8 comment:7 by , 13 years ago
Please double check you really have that version number in your About page of Trac and in the Apache logs.
comment:8 by , 13 years ago
Replying to cboos:
Please double check you really have that version number in your About page of Trac and in the Apache logs.
I am sorry, I recompile mod_wsgi-3.3 and install again, and issue gone. Thanks for your help.
comment:9 by , 13 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
No problem, thanks for the feedback.
I wanted to add a note in the wiki, but the problem is already well documented: TracModWSGI#Usearecentversion.
Duplicate of #7205.
Is there anything in your Trac or Apache log that could give us a hint about the issue?