I'm creating an applet that send pictures to a servlet.
The applet first action is to resize and compress the picture. I'm using ImageIO to load the picture into a BufferedImage. Next I resize the picture and then use ImageWriter to compress it in jpeg. That's work fine.
The problem is when the user send a very big pic(up to 70MP). The loading of the image in a BufferedImage exceeds the heap size and throws an "out of memory" exception.
How can I advoid that ?
Is it possible to compress a picture without fully load it in memory ? Maybe using stream only ? Or load subImage ?
Excuse me for my bad english, Thanks for your anwsers.