Something like this. Yes I can still reproduce, but have moved to pngs to get past it.
URL objUrl = this.getClass().getClassLoader().getResource("images/image1.jpg"); byte[] objBytes = Files.readAllBytes(Paths.get(objUrl.toURI())); try (ByteArrayInputStream bais = new ByteArrayInputStream(imageData)) { BufferedImage image = ImageIO.read(bais); //>> this is where the error occurs. return image; } catch (IOException e) { LOG.error(null, "Failed to create buffered image", e); throw new RuntimeException(e); }
Something like this. Yes I can still reproduce, but have moved to pngs to get past it.
URL objUrl = this.getClass( ).getClassLoade r().getResource ("images/ image1. jpg"); tes(Paths. get(objUrl. toURI() )); Stream bais = new ByteArrayInputS tream(imageData )) {
BufferedIm age image = ImageIO.read(bais); //>> this is where the error occurs.
LOG. error(null, "Failed to create buffered image", e); n(e);
byte[] objBytes = Files.readAllBy
try (ByteArrayInput
return image;
} catch (IOException e) {
throw new RuntimeExceptio
}