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

Batik 1.8: batik-rasterizer.jar can't convert svg to jpg from command line

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: SVG Rasterizer
    • Labels:
      None
    • Environment:
      Ubuntu 12.04.5
      java version "1.7.0_76"
      Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)

      Description

      I want to use batik-rasterizer.jar from command line to convert svg to various formats.

      I tried version 1.8 of batik, that worked out of the box with png, but failed with jpeg:

      Unable to export image; About to transcode 1 SVG file(s) Converting highcharts-in20150410-18593-78lbuf.svg to /home/local/PDC01/swi/Projects/jobwert/tmp/highcharts-out20150410-18593-4kjr1n.jpg ... org.apache.batik.transcoder.TranscoderException: null Enclosed Exception: null at org.apache.batik.transcoder.image.ImageTranscoder.transcode(Unknown Source) at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source) at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source) at org.apache.batik.apps.rasterizer.SVGConverter.transcode(Unknown Source) at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown Source) at org.apache.batik.apps.rasterizer.Main.execute(Unknown Source) at org.apache.batik.apps.rasterizer.Main.main(Unknown Source) ... error (SVGConverter.error.while.rasterizing.file)
      

      I've tried manipulating the class-path to explicitly link to the batik-codec.jar, e.g.:

      java -classpath batik-1.8/batik-codec.jar -jar batik-1.8/batik-rasterizer.jar -m image/jpeg -q 0.95 -d out.jpg  in.svg
      

      but that didn't help.

      After downgrading to version 1.7, the export/conversion works without error.

      How can I use batik-rasterizer.jar 1.8 from command line for JPEG images?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              stefanwienert Stefan Wienert
            • Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: