Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-1180

SVG to PNG Convertion

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Cannot Reproduce
    • 1.7, 1.8
    • None
    • SVG DOM
    • None
    • Java
    • Important

    Description

      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();

      Attachments

        1. 1489143870027.png
          10 kB
          balaji
        2. 1489143870027 - Copy - Copy.svg
          21 kB
          balaji

        Activity

          People

            Unassigned Unassigned
            Kamepalli balaji
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: