Skip to content

Commit

Permalink
Updated for the java.util.Base64 use
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Dec 17, 2023
1 parent 112d702 commit f673e84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/test/java/org/xmlcml/graphics/svg/SVGImageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public void testRoundtripImage() throws Exception {
Assert.assertNotNull("image", svgImage1);
svgImage.format(3);
// <image xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMklEQVR42mP4J8LwHx0zAAE2cWzyeBUSgxnw2UwMnzouINVmnF4YwmEwmg7Is3kYhQEA6pzZRchLX5wAAAAASUVORK5CYII=" />
Assert.assertEquals("image", "<image xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMklEQVR42mP4J8LwHx0zAAE2cWzyeBUSgxnw2UwMnzouINVmnF4YwmEwmg7Is3kYhQEA6pzZRchLX5wAAAAASUVORK5CYII=\" />",

Assert.assertEquals("image", "<image xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAVElEQVR4XmP4J8LwHx0zAAG6GC55vAqJwSgGoNtMDJ86LkA3iBAfwwBKMF6biOFT1wVwQQIGI8vjVUgMxvATqXzquADdIFL41HEBnIPHJlx8il0AAOqc2UWV+CVcAAAAAElFTkSuQmCC\" />",
svgImage1.toXML());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ public void testCreateImageFromHref() throws IOException {
imageFilenameList.get(0));
// check file has been written
SVGElement svgElement = SVGImage.createSVGFromImage(new File(imageFilenameList.get(0)), SVGImage.IMAGE_PNG);
Assert.assertEquals("image", "<image xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMklEQVR42mP4J8LwHx0zAAE2cWzyeBUSgxnw2UwMnzouINVmnF4YwmEwmg7Is3kYhQEA6pzZRchLX5wAAAAASUVORK5CYII=\" />",
Assert.assertEquals("image", "<image xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAVElEQVR4XmP4J8LwHx0zAAG6GC55vAqJwSgGoNtMDJ86LkA3iBAfwwBKMF6biOFT1wVwQQIGI8vjVUgMxvATqXzquADdIFL41HEBnIPHJlx8il0AAOqc2UWV+CVcAAAAAElFTkSuQmCC\" />",
svgElement.toXML());

}

@Test
Expand Down

0 comments on commit f673e84

Please sign in to comment.