[ 
https://issues.apache.org/jira/browse/ZETACOMP-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

FazaƩ updated ZETACOMP-82:
--------------------------

    Attachment: zeta_hrefimage.patch

> 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Ʃ
>         Attachments: zeta_hrefimage.patch
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> 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

Reply via email to