[imp] msword: display images

Jie Gao jiegao at mail.usyd.edu.au
Wed Mar 17 15:16:19 PST 2004


Hi All,

horde-2.2.5 + IMP releng cvs
----------------------------

This is about displaying msword attachments. The display of text is
fine but not the images in the word doc. They have broken links.

This so because wvWare puts the images in where msword files are,
which is not in the web space.

I used to be able to get around this by replacing the following:


        // $out = fopen($tmp_output, 'r');
        // $data = '';
        // while (($rc = fgets($out, 8192))) {
        //     $data .= $rc;
        // }

with:


        $dump_url = Horde::url($GLOBALS['registry']->getParam('webroot', 'horde') .
'/dump_image.php?image=', true);
        $out = fopen($tmp_output, 'r');
        $data = '';
        while (($rc = fgets($out, 8192))) {
            $rc    = str_replace('src="' . $tmp_file, 'src="' . $dump_url . $tmp_file, $rc);
            $data .= $rc;
        }


in horde/lib/MIME/Viewer/msword.php. The fix replaces the link with a
php call to display the image inline.

Now I find I can't do that any more, for dump_image.php is not there anymore.

Any suggestions?

Thanks for any help.




Jie


More information about the imp mailing list