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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]