Modify ↓
Opened 12 years ago
Closed 12 years ago
#10659 closed defect (fixed)
TracImgSvg no longer works due to a change in how attachments are stored.
Reported by: | Nathaniel Madura | Owned by: | Richard Liao |
---|---|---|---|
Priority: | high | Component: | TracImageSvgMacro |
Severity: | critical | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
See this ticket http://trac.edgewall.org/ticket/10313 for more details, but the attachments directory has moved to files/attachments and the attachment names are SHA-1'ed along with their page name.
Attached is a unified diff of a solution to the problem. note that wiki pages can have depth "some/page/to/wiki" which is why you can't assume the wiki page is in the 5th position of the array.
Attachments (1)
Change History (4)
Changed 12 years ago by
Attachment: | web_ui.0.11_1.0.patch added |
---|
comment:1 Changed 12 years ago by
Ahh crap, I did the patch backwards so the +'s and -'s need to be flipped.
like so...
-
imagesvg/web_ui.py
old new 152 152 def process_request(self, req): 153 153 if req.path_info.startswith("/svg"): 154 154 pathSegs = req.path_info.split("/") 155 image_path = "/".join(pathSegs[2:]) 156 f = os.path.join(self.env.path, image_path) 155 # pathSegs[1] == svg 156 # pathSegs[2] == attachments 157 # pathSegs[3] == wiki | ticket 158 # pathSegs[n] == filename.ext 159 attachment = Attachment(self.env, pathSegs[3], "/".join(pathSegs[4:-1])) 160 attachment.filename = pathSegs[-1] 161 self.log.info("SVG Attachment: %s" % (attachment.path)) 157 162 try: 158 message = open( f).read()163 message = open(attachment.path).read() 159 164 except: 160 165 raise HTTPException(404)
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
patch to get ImgSVG working on trac 1.0