JAI save a .jpg file -- failed to be previewed.
Sorry for my stupid question. I'm trying to save an .jpg file using JAI. My code is as follows:
BufferedImage bImage = doRender(width, height);
RenderedImage fImage = JAI.create("format", bImage, DataBuffer.TYPE_BYTE);
JAI.create("filestore", fImage, filename + ".jpg", "jpeg", null);
However, Eclipse notified that the 2nd line is deprecated and there is a cross line on "create" in the 2nd line.
What's more, even if the 2nd line is deprecated, I'm still able to save an image in .jpg format. However, what has been saved can not be previewed by many softwares, including "Windows Picture and Fax Viewer", "Image Magic Display", "Windows Paint", etc. I can only preview the image by using "QuickTime Picture Viewer". That's not actually what I expected and I think the saved image should be able to be previewed by all the popular softwares.
So, can you please help to give me your code when you tried to save .jpg files? Thanks in advance.