Summary | images in MS Word document |
Queue | Horde Framework Packages |
Queue Version | FRAMEWORK_3 |
Type | Bug |
State | Not A Bug |
Priority | 2. Medium |
Owners | |
Requester | dgehl (at) inverse (dot) ca |
Created | 11/24/2005 (7244 days ago) |
Due | |
Updated | 11/24/2005 (7244 days ago) |
Assigned | |
Resolved | 11/24/2005 (7244 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Not A Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ images in MS Word document
Queue ⇒ Horde Framework Packages
When viewing attached MS Word documents, images inside the documents
are extracted by wvhtml and created in the temporary directory (/tmp
in my case). Unfortunately, the html returned to the user does not
contain any directory instruction so that all images are shown as
broken links.
A solution is to add a regular expression to
lib/Horde/MIME/Viewer/msword.php which rewrites to <img src > part.
Replacing
return $data
by
return preg_replace('/<img width="(\d+)" height="(\d+)" alt="([^"]+)"
src="([^"]+)"/i', '<img width="${1}" height="${2}" alt="${3}"
src="/wvTmpImages/${4}"', $data);
instructs the browser to fetch to images from wvTmpImages
This directory can then be created as an alias in Apache
Alias /wvTmpImages/ "/tmp/"
<Directory /tmp>
<Files *.png>
Order allow,deny
Allow from all
</Files>
Order allow,deny
Deny from all
</Directory>