File imageFile = new File("./src/test/resources/org/geotools/renderer/lite/test-data/draw.png").getCanonicalFile();
assertTrue(imageFile.exists());
String fileUrl = DataUtilities.fileToURL(imageFile).toExternalForm();
PointSymbolizer ps = sb.createPointSymbolizer(sb.createGraphic(null, null, sb.createExternalGraphic(fileUrl, "image/png")));
GraphicsAwareDpiRescaleStyleVisitor visitor = new GraphicsAwareDpiRescaleStyleVisitor(2);
ps.accept(visitor);
PointSymbolizer resized = (PointSymbolizer) visitor.getCopy();
Expression size = resized.getGraphic().getSize();
assertTrue(size instanceof Literal);
// original image height was 22
assertEquals(44, size.evaluate(null, Integer.class), 0d);