I need to convert a BufferedImage
to a File
. I tried the following, but it did not work:
File file = null;
ImageIO.write(image, "jpg", file);
image
is of type BufferedImage
.
That was the error:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: output == null! at javax.imageio.ImageIO.write (Unknown Source) *