Modify

Opened 17 years ago

Last modified 15 years ago

#1022 new defect

Wrong mime type for SVG

Reported by: anonymous Owned by: Christian Boos
Priority: high Component: GraphvizPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.11

Description

GraphvizPlugin sends wrong mime type for SVG file. Thats why I couldn't see a SVG object with Firefox's build-in SVG plugin.

I've fixed it.

Just replace this line

return req.send_file(img_path)

by this one

req.send_file(img_path, mimeview.get_mimetype(img_path))

And set import

from trac import mimeview

Attachments (0)

Change History (4)

comment:1 Changed 17 years ago by Peter Kropf

Fixed w/ changeset:1731.

comment:2 Changed 17 years ago by Peter Kropf

Resolution: fixed
Status: newclosed

comment:3 Changed 15 years ago by jholg

Resolution: fixed
Status: closedreopened
Trac Release: 0.100.11

Using GraphvizPlugin 0.7.2 I ran into this problem so I suppose this fix has been lost somewhere on the way (it fixes things for me). So

replacing

return req.send_file(img_path)

by

return req.send_file(img_path, get_mimetype(img_path))

and changing the import

from trac.mimeview.api import IHTMLPreviewRenderer, MIME_MAP

to

from trac.mimeview.api import IHTMLPreviewRenderer, MIME_MAP, get_mimetype

is still needed.

Regards, Holger

comment:4 Changed 15 years ago by Christian Boos

Owner: changed from Peter Kropf to Christian Boos
Priority: normalhigh
Status: reopenednew

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Christian Boos.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.