xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: JPEGTranscoder Error
Date Fri, 17 Aug 2007 10:07:25 GMT
Hi Saehoon,

"Saehoon Cheon" <saehoon.cheon@gmail.com> wrote on 08/16/2007 08:39:20 PM:

> But it causes error.
> The error is occurred "t.transcode(input, output);"  and  the 
> message is " org.apache.batik.transcoder.TranscoderException: null".
> I think that the code is not reading correct file from folder or 
> writing file to folder.

   Yes, this is the problem:

>         // Create the transcoder input.
>         String svgURI = new File("C:/tmp/svgtest.svg").toString();
>         TranscoderInput input = new TranscoderInput(svgURI); 

    Your svgURI is not a URI it's a file path.  Try using
the method: File.toURI().


> 
>         // Create the transcoder output.
>         OutputStream ostream = new FileOutputStream("C:/tmp/out.jpg");
>         TranscoderOutput output = new TranscoderOutput(ostream);
> 
>         try{ 
>             // Save the image.
>             t.transcode(input, output); 
> <<<<<<<<==================== null exception 
>         }catch (TranscoderException ex) {
>             ex.printStackTrace();
>         }
> 
>         // Flush and close the stream.
>         ostream.flush();
>         ostream.close();
>         System.exit (0);
> 
======================================================================================
> -- 
> Saehoon Cheon
> The University of Arizona
> Dept.Electrical and Computer Engineering 

---------------------------------------------------------------------
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