[jira] [Created] (BATIK-1180) SVG to PNG Convertion

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] [Created] (BATIK-1180) SVG to PNG Convertion

JIRA jira@apache.org
balaji created BATIK-1180:
-----------------------------

             Summary: SVG to PNG Convertion
                 Key: BATIK-1180
                 URL: https://issues.apache.org/jira/browse/BATIK-1180
             Project: Batik
          Issue Type: Bug
          Components: SVG DOM
    Affects Versions: 1.8, 1.7
         Environment: Java
            Reporter: balaji
            Priority: Critical
         Attachments: 1489143870027 - Copy - Copy.svg, 1489143870027.png

Created SVG object . When I open directly that svg in browser looks good.
When I Convert this to PNG clarity was gone.

Attached both SVG and generated PNG.

Appreciate for early response


Sample Code what we are using

svg_URI_input = new File(filePath + fileNameWithoutExt + ".svg").toURL().toString();
                        TranscoderInput input_svg_image = new TranscoderInput(svg_URI_input);
                        OutputStream png_ostream = new FileOutputStream(filePath + fileName);
                        TranscoderOutput output_png_image = new TranscoderOutput(png_ostream);
                        PNGTranscoder my_converter = new PNGTranscoder();
                        my_converter.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(1.0));
                        my_converter.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT, 250f);
                        my_converter.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, 1292f);
                       
                        // Write output
                        my_converter.transcode(input_svg_image, output_png_image);
                        // close / flush Output Stream
                        png_ostream.flush();
                        png_ostream.close();



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...