xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbr...@idbs.com
Subject transcoder error with svg file including a tiff image.
Date Wed, 07 Mar 2007 16:28:17 GMT

I am trying to transcode an svg file into a jpg, the svg file contains an
image tag with a link to an image file, if the image is a .jpg or .png or
.gif it works fine but if the image is a tiff I get the following error:

Could not find mediaLib accelerator wrapper classes. Continuing in pure
Java mode.
org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
1030
      at
org.apache.batik.transcoder.image.ImageTranscoder.transcode(Unknown Source)
      at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
      at
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
      at com.idbs.ewb.image.SVGUtil.saveJPG(SVGUtil.java:65)


This is the code I am using:

public static byte[] saveJPG(Document document) throws Exception
    {
        JPEGTranscoder t = new JPEGTranscoder();
        t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,
                             new Float(.8));

        TranscoderInput input = new TranscoderInput(document);
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        TranscoderOutput output = new TranscoderOutput(outputStream);

        t.transcode(input, output);
        outputStream.flush();
        outputStream.close();

        return outputStream.toByteArray();
    }

Any help would be greatly appreciated.  Thanks.

Victoria.



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message