On Jul 10, 2006, at 6:17 PM, Ross Gardler wrote:
Paul Bolger wrote:
Has anyone had any luck getting the odt plugin to translate graphics
from a source document yet?

I've not looked at the ODT plugin and am unlikely to do so in the forseeable future. However, I will mention again that I spent some time making this work in the original OOo plugin. I don't believe the two formats are that different that we cant reuse the same solution.

Ross

I was able to get graphics to display with the ODT plugin. I'll paste my `svn diff` below.

NOTE: Unfortunately, it broke the OOo plugin's ability to process images (which I still use to convert an OOo Impress file). I believe my serializer 'hi-jacked' or 'superceded' the graphics portion of the OOo Impress converter.

Hopefully you'll get some ideas here. I got stuck, and then had some more pressing 'issues' to deal with (like a newborn...).

[EMAIL PROTECTED] org.apache.forrest.plugin.input.odt]$ svn diff
Index: input.xmap
===================================================================
--- input.xmap  (revision 411040)
+++ input.xmap  (working copy)
@@ -49,6 +49,16 @@
         <map:serialize type="xml" />
       </map:match>
     </map:pipeline>
+
+    <!-- Image Pipeline -->
+    <map:pipeline internal="true">
+      <map:match pattern="openDocumentEmbeddedImage/zip-{1}.odt/file-**.*">
+        <map:read src="" mime-type="image/{3}" />
+      </map:match>
+      <map:match pattern="**/openDocumentEmbeddedImage/zip-{1}.odt/file-**.*">
+        <map:read src="" mime-type="image/{4}" />
+      </map:match>
+    </map:pipeline>
   </map:pipelines>
</map:sitemap>
Index: resources/stylesheets/odt-to-forrest-xhtml.xsl
===================================================================
--- resources/stylesheets/odt-to-forrest-xhtml.xsl      (revision 411040)
+++ resources/stylesheets/odt-to-forrest-xhtml.xsl      (working copy)
@@ -18,6 +18,7 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+  xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
   xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
   xmlns:xlink="http://www.w3.org/1999/xlink"
@@ -57,4 +58,14 @@
       </body>
     </html>
   </xsl:template>
+
+  <!--+
+      | Images
+      +-->
+  <xsl:template match="draw:[EMAIL PROTECTED]:show]">
+    <xsl:variable name="href"><xsl:value-of select="@xlink:href"/></xsl:variable>
+    <img src=""
+      alt="[EMAIL PROTECTED]:name}" class="{./../@draw:style-name}" />
+  </xsl:template>
+
</xsl:stylesheet>


Web Maestro Clay

My religion is simple. My religion is kindness.
-- HH Dalai Lama of Tibet