File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
resources/io/sf/carte/example/mermaid Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ sourceSets {
15
15
}
16
16
resources {
17
17
srcDirs = [' src/examples/resources' , ' imag' ]
18
- includes = [' hdrbg.svg' , ' **/profiles/ *' ]
18
+ includes = [' hdrbg.svg' , ' io/sf/* *' ]
19
19
}
20
20
}
21
21
}
Original file line number Diff line number Diff line change 42
42
import io .sf .carte .echosvg .transcoder .TranscoderInput ;
43
43
import io .sf .carte .echosvg .transcoder .TranscoderOutput ;
44
44
import io .sf .carte .echosvg .transcoder .image .PNGTranscoder ;
45
+ import io .sf .carte .echosvg .transcoder .util .CSSTranscodingHelper ;
45
46
46
47
/**
47
48
* The purpose of this test is to verify that EchoSVG can be run with the given
@@ -120,6 +121,21 @@ static SVGGraphics2D createSVGGraphics2D() {
120
121
return new SVGGraphics2D (ctx , false );
121
122
}
122
123
124
+ @ Test
125
+ public void testTranscodingHelper () throws Exception {
126
+ PNGTranscoder transcoder = new PNGTranscoder ();
127
+ CSSTranscodingHelper helper = new CSSTranscodingHelper (transcoder );
128
+ ByteArrayOutputStream ostream = new ByteArrayOutputStream (700 );
129
+ TranscoderOutput output = new TranscoderOutput (ostream );
130
+ ErrorHandler handler = new ExceptionErrorHandler ();
131
+ transcoder .setErrorHandler (handler );
132
+ try (Reader re = loadDocumentFromClasspath ("/io/sf/carte/example/mermaid/block.svg" )) {
133
+ TranscoderInput input = new TranscoderInput (re );
134
+ helper .transcode (input , output );
135
+ }
136
+ assertTrue (ostream .size () > 8000 , "Mermaid image had size of only " + ostream .size () + "." );
137
+ }
138
+
123
139
@ Test
124
140
public void testTranscoding () throws Exception {
125
141
org .w3c .dom .DOMImplementation impl = SVGDOMImplementation .getDOMImplementation ();
You can’t perform that action at this time.
0 commit comments