[
https://issues.apache.org/jira/browse/BATIK-818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15264021#comment-15264021
]
Ralph Hummeling edited comment on BATIK-818 at 4/29/16 1:42 PM:
----------------------------------------------------------------
L.S.
This bug is still present in release 1.8.
I have a Maven project that uses the batik-swing artifact from the UK Maven
Central mirror. Adding the batik-codec-1.8 artifact doesn't prevent the
Enclosed Exception from being thrown.
Note that in my specific case, fop-2.1 is another project dependency that
ensures presence of the batik-transcoder-1.8 artifact when batik-codec-1.8
isn't included.
The batik-codec-1.7 contains a package
(org.apache.batik.ext.awt.image.codec.jpeg) not present in batik-codec-1.8.
Could these missing JPEGImageWriter and JPEGRegistryEntry classes cause this
exception?
This issue could be related to BATIK-1111, BATIK-1114, and BATIK-1136.
Kind regards
was (Author: hummeling):
L.S.
This bug is still present in release 1.8.
I have a Maven project that uses the batik-swing artifact from the UK Maven
Central mirror. Adding the batik-codec-1.8 artifact doesn't prevent the
Enclosed Exception from being thrown.
Note that in my specific case, fop-2.1 is another project dependency that
ensures presence of the batik-transcoder-1.8 artifact when batik-codec-1.8
isn't included.
The batik-codec-1.7 contains a package
(org.apache.batik.ext.awt.image.codec.jpeg) not present in batik-codec-1.8.
Could these missing JPEGImageWriter and JPEGRegistryEntry classes cause this
exception?
Kind regards
> TranscoderException and EnclosedException when transcoding SVG to JPEG
> ----------------------------------------------------------------------
>
> Key: BATIK-818
> URL: https://issues.apache.org/jira/browse/BATIK-818
> Project: Batik
> Issue Type: Bug
> Components: SVG Rasterizer
> Affects Versions: 1.8
> Environment: Operating System: Linux
> Platform: PC
> Reporter: ks
> Assignee: Batik Developer's Mailing list
>
> Hi,
> when I try to follow the description on
> http://xmlgraphics.apache.org/batik/using/transcoder.html#createImage
> to create a jpg-image file from a svg-file in a JUnitTest, I get the
> following error message:
>
> org.apache.batik.transcoder.TranscoderException: null
> Enclosed Exception:
> null
> at
> org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:132)
> at
> org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)
> at
> org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)
> at
> de.vitronic.test.TestJPEGTranscoder.testJPEGTranscoder(TestJPEGTranscoder.java:57)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> The batik version I use is 1.7.
> First I tried to transform a created svg-file into jpeg-file in my own
> application, but I get the same exception, so I copied the example code from
> the previous mentioned website in a JUnit-Testcase to figure out if I have
> done anything wrong in my application. But I got the same problem again, with
> the copied and pasted code (see above).
> When I ran the rasterizer.jar file to convert the image, there is no such an
> exception thrown. I looked at the code from SVGGenerator from the Rasterizer
> application, but I doesn´t found a solution, so far to solve the problem.
> So here is the code from my JUnitTest method:
> public void testJPEGTranscoder() {
> // Create a JPEG transcoder
> JPEGTranscoder t = new JPEGTranscoder();
> // Set the transcoding hints.
> t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(.8));
> // Create the transcoder input.
> String svgURI;
> try {
> svgURI = new File("test/TestInput.svg").toURL().toString();
> TranscoderInput input = new TranscoderInput(svgURI);
> // Create the transcoder output.
> OutputStream ostream = new FileOutputStream(
> "test/TestOutput.jpg");
> TranscoderOutput output = new TranscoderOutput(ostream);
> // Save the image.
> t.transcode(input, output);
> // Flush and close the stream.
> ostream.flush();
> ostream.close();
> // System.exit(0);
> } catch (MalformedURLException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (FileNotFoundException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (TranscoderException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
> Thanks in advance for your help,
> ks
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]