Modify ↓
Opened 12 years ago
Last modified 12 years ago
#11122 new enhancement
problems with DiaVisView Images
| Reported by: | anonymous | Owned by: | Aurélien Bompard |
|---|---|---|---|
| Priority: | normal | Component: | OdtExportPlugin |
| Severity: | normal | Keywords: | DiaVisView |
| Cc: | Trac Release: |
Description
If I export a page with a DiaVisView Macro call the resulting odt document contained just an empty Image container.
I did this hack to make it work:
--- odtexport.py 2013-03-25 00:56:46.000000000 +0100
+++ odtexport.py 2013-05-28 16:07:53.000000000 +0200
@@ -262,6 +262,9 @@
# Handle attached images
html = re.sub('<img [^>]*src="(%s/raw-attachment/([^/]+)(?:/([^"]*))?)"'
% base_url, self.handle_attached_img, html)
+ # Handle DiaVisView images
+ html = re.sub('<img [^>]*src="(%s/attachment/([^/]+)(?:/([^"]*))?)"'
+ % base_url, self.handle_attached_img, html)
# Handle chrome images
html = re.sub('<img [^>]*src="(%s/chrome/([^"]+))"'
% base_url, self.handle_chrome_img, html)
@@ -278,6 +281,8 @@
path_segments = path.split("/")
parent_id = '/'.join(path_segments[:-1])
filename = len(path_segments) > 1 and path_segments[-1]
+ filename = re.sub('\?format=raw','',filename)
+ self.env.log.debug('filename: %s' % filename)
attachment = Attachment(self.env, realm, parent_id, filename)
filename = attachment.path
if not os.path.exists(filename): # fallback
Attachments (0)
Note: See
TracTickets for help on using
tickets.



Which version of Trac are you running?