incubator-zeta-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From FazaƩ (JIRA) <j...@apache.org>
Subject [jira] [Created] (ZETACOMP-82) ezcDocumentDocbookToOdtConverter does not handle externally linked pictures
Date Fri, 13 May 2011 10:33:47 GMT
ezcDocumentDocbookToOdtConverter does not handle externally linked pictures
---------------------------------------------------------------------------

                 Key: ZETACOMP-82
                 URL: https://issues.apache.org/jira/browse/ZETACOMP-82
             Project: Zeta Components
          Issue Type: Bug
          Components: Document
         Environment: Kubuntu 11.04
            Reporter: FazaƩ


When i tried to convert HTML to ODT, ezcDocumentDocbookToOdtConverter failed on <img src="http://...">.

Error message:  "Could not find image http://..."

The problem is :
- $converter->getImageLocator()->locateImage check if file_exist on the filesystems.
- the image is base64 included in the document. then the external location is lost.

I have made a little patch in order to manage external images.
Do you think someone can put this patch in SVN ?
The converter is still working as before for real file. 


# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -119,6 +119,17 @@
             ( $imgFile = $imageData->getAttribute( 'fileref' ) )
         );
 
+        // do we have an external image ?
+        if ( $imgPath === false && parse_url($imgFile,PHP_URL_SCHEME)=="http")
+        {
+        $imgPath=$imgFile;
+        $image->setAttributeNS(ezcDocumentOdt::NS_XLINK,  'xlink:href',    $imgPath );
+        $image->setAttributeNS(ezcDocumentOdt::NS_XLINK,  'xlink:type',    "simple" );
+        $image->setAttributeNS(ezcDocumentOdt::NS_XLINK,  'xlink:show',    "embed" );
+        $image->setAttributeNS(ezcDocumentOdt::NS_XLINK,  'xlink:actuate', "onLoad" );
+        return $root;
+        }
+
         if ( $imgPath === false )
         {
             $converter->triggerError(


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message