xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36924] New: - ImageTranscoder fails with certain SVG image with embedded URL
Date Tue, 04 Oct 2005 23:28:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36924>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36924

           Summary: ImageTranscoder fails with certain SVG image with
                    embedded URL
           Product: Batik
           Version: 1.6
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Bridge
        AssignedTo: batik-dev@xml.apache.org
        ReportedBy: steveshaw@ca.ibm.com


With a specific svg image file the ImageTranscoder throws a BridgeException of 
malformed URL.  The transcoder works properly if the FileInputStream is sent 
directly to the transcoder.  In the client implementation this is not an 
option since the SVG has been previously serialized to a byte array for 
caching.  (see attached svg).

// create a JPEG transcoder
        JPEGTranscoder t = new JPEGTranscoder();
        
        FileInputStream fis = new FileInputStream("C:\\test7.svg");
		int size = fis.available();
		byte[] svgBuffer = new byte[size];
		
		fis.read(svgBuffer);
		fis.close();
		
        // set the transcoding hints
        t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,
                             new Float(.8));
        // create the transcoder input
        InputStream in = new ByteArrayInputStream(svgBuffer);
		
        TranscoderInput input = new TranscoderInput(in);
		
        // create the transcoder output
        OutputStream ostream = new FileOutputStream("C:\\test7.jpg");
        TranscoderOutput output = new TranscoderOutput(ostream);
        // save the image
        t.transcode(input, output);
        // flush and close the stream then exit
        ostream.flush();
        ostream.close();

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message