Thomas:
I have not had success getting the CVS version of Batik. I did manage
to create the following test application that
shows the same behaviour.
Any advice on correcting this would be appreciated.
Thanks in advance,
Charlie
P.S. I have put the test SVG file on our public server, so the URL
should work as coded in the attachement.
Thomas E Deweese wrote:
>>>>>>"CHW" == Charles H Woloszynski <[EMAIL PROTECTED]> writes:
>>>>>>
>
>CHW> I have a servlet that reads an SVG from a URL and then feeds that
>CHW> (via a TranscoderInput) into the JPEGTranscoder.
>
>CHW> If I have define a clippath (I have it in the <defs> and then I
>CHW> references this in the body (e.g., <g
>CHW> clip-path="url(#plotClipArea)" ...
>
>CHW> then I get the following exception traceback
>
> I would suggest trying CVS Batik (I believe I fixed a bug in this
>area since 1.5B3). If this doesn't solve the problem can you
>construct a standalone Java file that reproduces this bug?
>
> Using the Transcoder I can't reproduce it.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
/*
* Transcoder.java
*
* Created on August 1, 2002, 2:34 PM
*/
import java.io.IOException;
import java.util.*;
import java.net.*;
import java.io.*;
import org.apache.batik.transcoder.*;
import org.apache.batik.transcoder.image.*;
/**
*
* @author chw
*/
public class TranscoderApp {
/** Creates a new instance of Transcoder */
public TranscoderApp() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String urlText="http://www.clearmetrix.com/svg_chart.svg";
System.err.println("URL to transcode is: "+ urlText);
URL url = null;
HttpURLConnection httpConnection = null;
URLConnection connection = null;
InputStream is = null;
try {
url = new URL(urlText);
connection = url.openConnection();
try {
httpConnection = (HttpURLConnection) connection;
}
catch (ClassCastException ccex) {
httpConnection = null;
}
if (httpConnection != null)
System.err.println("SVG URL content
type="+connection.getContentType());
is = System.in;
if (connection == null || (httpConnection != null &&
httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK)) {
//
// Error getting content, report
//
System.err.println("Error getting content. Exiting");
System.exit(0);
}
else {
is = connection.getInputStream();
};
}
catch (java.net.MalformedURLException muex) {
System.err.println("Malformed URL encountered. url="+urlText+" (replaced
with error URL)");
connection = null;
}
catch (java.io.FileNotFoundException nffex) {
System.err.println("File not found using provided URL. Not used");
connection = null;
}
catch (java.io.IOException ioex) {
System.err.println("IOException");
connection = null;
}
OutputStream os = System.out;
TranscoderInput ti = new TranscoderInput(is);
TranscoderOutput to = new TranscoderOutput(os);
System.err.println("Creating transcoder");
// Transcoder codec = new PNGTranscoder();
Transcoder codec = new JPEGTranscoder();
// set the transcoding hints for JPEG
codec.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,
new Float(0.8));
System.err.println("Completed 'new'");
try {
System.err.println("Transcoding");
codec.transcode(ti, to);
System.err.println("Completed transcoding");
}
catch (TranscoderException tex) {
System.err.println("Unexpected Transcoder Exception");
}
System.err.println("Exiting perform()");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]