Showing Base64String Image with Thymeleaf
I am storing jpg images in a database (as byte array). I want to avoid dropping onto filesystem before showing on a web page. Unit Tests show that database storage and retrieval are working without corruption. Fies can be extracted from database and converted back to jpg file The image was converted to bytearray and stored in database with the following code: public static byte[] getImageAsBytes(BufferedImage buffer) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageIO.write(buffer, "jpg", baos); baos.flush(); byte[] imageInByte = baos.toByteArray(); baos