I am doing a JAX-RS axios GET and am trying to display the base64 string (length 87394260) the backend returned in REACT. For smaller png the src line works as expected, but when I try to display panorama size pictures of 65 MB or bigger the
<img
src={`data:image/png;base64,${image64}`}
alt="panorama.png"
width='100%'
height='100px'
/>
doesn’t do anything. There are no error messages in the console and I see the Alt message instead. I tried to set width and height but that also doesn’t help. Is there some workaround to fix this problem? There must be some way to do large files.
I have been searching on Large base64 strings not displaying, but have not found anything.
2
Answers
So it would be nice to serve images not inline in an
img src=data
but as file.In every case using JPEG can be done, also resulting in a faster load.
From the comments I decided to create a /var/company/rdt/images directory that tomcat can see as a docDoc directory. I then copy the images to the directory and add a random number to the names like panoramaA123.png. Then the servlet sends the URL links to the pictures to the frontend React project. React sees the url link changes and the image is reloaded. The browser doesn’t have any problem displaying the image. It would be nice to know how the browser is doing that, but my display page is working now.