Modify

Opened 8 years ago

Last modified 5 years ago

#1022 new defect

Wrong mime type for SVG

Reported by: anonymous Owned by: cboos
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 8 years ago by pkropf

Fixed w/ changeset:1731.

comment:2 Changed 8 years ago by pkropf

  • Resolution set to fixed
  • Status changed from new to closed

comment:3 Changed 6 years ago by jholg

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Trac Release changed from 0.10 to 0.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 5 years ago by cboos

  • Owner changed from pkropf to cboos
  • Priority changed from normal to high
  • Status changed from reopened to new

Add Comment

Modify Ticket

Action
as new The owner will remain cboos.
Author


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

 
Note: See TracTickets for help on using tickets.