We would like to know how to get supported image types.
import javax.imageio.ImageIO; /*w ww . j a va2 s.c o m*/ public class Main { public static void main(String[] args) throws Exception { String[] types = ImageIO.getReaderFileSuffixes(); System.out.println("This JRE supports image types:"); for (String type : types) { System.out.println("Type: " + type); } } }
This JRE supports image types: Type: bmp Type: jpg Type: wbmp Type: jpeg Type: png Type: gif
The code above generates the following result.