You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lincoln Mitchell <li...@linc.net.au> on 2004/09/11 04:15:08 UTC
Out of Memory error base64 encoded to SVG to JPG
I need to convert multiple wordml images (base64 encoded) to JPG.
I am currently using the following code but get an "Out of Memory" error. If
I am lucky I get 2 images appear on screen.
I will try importing low quality JPEG into word to see if that helps and
also thinking of upgrading RAM or PC current spec is Celeron 2.4GHz, 448MB
RAM, Running Windows XP (home edition).
Any clues/recommendations?
Linc
Sitemap.xmap
------------
<map:match pattern="*.jpg">
<map:generate src="content/content.xml"/>
<map:transform src="stylesheets/wordml2svg.xsl">
<map:parameter name="image" value="{1}"/>
</map:transform>
<map:serialize type="svg2jpeg"/>
</map:match>
wordml2svg.xsl
--------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office">
<xsl:param name="image"/>
<xsl:template match="/">
<xsl:apply-templates select="//w:pict"/>
</xsl:template>
<xsl:template match="//w:pict">
<xsl:if test="v:shape/v:imagedata[@o:title=$image]">
<xsl:apply-templates select="w:binData"/>
</xsl:if>
</xsl:template>
<xsl:template match="w:binData">
<svg:svg xmlns:svg="http://www.w3.org/SVG"
width="40" height="30">
<svg:g>
<svg:image
xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="30">
<xsl:attribute
name="xlink:href"><xsl:text>data:image/png;base64,</xsl:text><xsl:value-of
select="."/></xsl:attribute>
</svg:image>
</svg:g>
</svg:svg>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org