Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/libs.jsvg/external/binaries-list
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.

A84D34480044DB51A1448E9C0E32BD284B797288 com.github.weisj:jsvg:1.6.1
2B5F6F42F2B26EE72F6405F66F839DEF459CCA3C com.github.weisj:jsvg:1.7.1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Name: JSVG
Version: 1.6.1
Version: 1.7.1
Description: JSVG - A Java SVG implementation
License: MIT-jsvg
Origin: JSVG
URL: https://github.com/weisJ/jsvg
Files: jsvg-1.6.1.jar
Files: jsvg-1.7.1.jar

MIT License

Expand Down
5 changes: 3 additions & 2 deletions platform/libs.jsvg/manifest.mf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.libs.jsvg
OpenIDE-Module-Implementation-Version: 1
OpenIDE-Module: org.netbeans.libs.jsvg/2
OpenIDE-Module-Implementation-Version: 1.7.1
OpenIDE-Module-Specification-Version: 2.0
Comment on lines -2 to +4
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made it 2.0 instead of 2.0.0 since all other spec manifests seem to use only two components.

updated projext.xml of platform/openide.util.ui.svg to make it compile

OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jsvg/Bundle.properties
AutoUpdate-Show-In-Client: false
7 changes: 4 additions & 3 deletions platform/libs.jsvg/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
# specific language governing permissions and limitations
# under the License.

file.reference.jsvg-1.6.1.jar=external/jsvg-1.6.1.jar
release.external/jsvg-1.6.1.jar=modules/ext/jsvg-1.6.1.jar
file.reference.jsvg-1.7.1.jar=external/jsvg-1.7.1.jar
release.external/jsvg-1.7.1.jar=modules/ext/jsvg-1.7.1.jar

is.autoload=true
javac.source=1.8

nbm.homepage=https://github.com/weisJ/jsvg

sigtest.gen.fail.on.error=false
spec.version.base=1.23.0
spec.version.base.fatal.warning=false
4 changes: 2 additions & 2 deletions platform/libs.jsvg/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
<package>com.github.weisj.jsvg.util</package>
</public-packages>
<class-path-extension>
<runtime-relative-path>ext/jsvg-1.6.1.jar</runtime-relative-path>
<binary-origin>external/jsvg-1.6.1.jar</binary-origin>
<runtime-relative-path>ext/jsvg-1.7.1.jar</runtime-relative-path>
<binary-origin>external/jsvg-1.7.1.jar</binary-origin>
</class-path-extension>
</data>
</configuration>
Expand Down
3 changes: 2 additions & 1 deletion platform/openide.util.ui.svg/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>1.0</specification-version>
<release-version>2</release-version>
<specification-version>2.0</specification-version>
</run-dependency>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.github.weisj.jsvg.SVGDocument;
import com.github.weisj.jsvg.geometry.size.FloatSize;
import com.github.weisj.jsvg.parser.LoaderContext;
import com.github.weisj.jsvg.parser.ParsedDocument;
import com.github.weisj.jsvg.parser.ResourceLoader;
import com.github.weisj.jsvg.parser.SVGLoader;
import com.github.weisj.jsvg.renderer.awt.NullPlatformSupport;
Expand Down Expand Up @@ -128,14 +129,13 @@ private static SVGDocument loadSVGDocument(URL url, Dimension toSize) throws IOE

final SVGDocument svgDocument;
FloatSize documentSize;
InputStream is = url.openStream();
try {
try (InputStream is = url.openStream()) {
// Explicitly deny loading of external URLs.

/* Handle e.g. <image href="https://example.com/image.png"> elements. Tested in
testLoadImageWithExternalImageHref. */
List<IOException> externalResourceExceptions = new ArrayList<>();
ResourceLoader resourceLoader = (URI nnuri) -> {
ResourceLoader resourceLoader = (ParsedDocument nnpd, URI nnuri) -> {
IOException e = new IOException("External resource loading from SVG file not permitted ("+
nnuri + " from " + url + ")");
externalResourceExceptions.add(e);
Expand Down Expand Up @@ -168,8 +168,6 @@ private static SVGDocument loadSVGDocument(URL url, Dimension toSize) throws IOE
} catch (RuntimeException e) {
/* Rethrow any uncaught exceptions that could be thrown when parsing invalid SVG files. */
throw new IOException("Error parsing SVG file", e);
} finally {
is.close();
}
if (toSize != null) {
int width = (int) Math.ceil(documentSize.getWidth());
Expand Down
Loading