public class Main { public static void main(String[] argv) throws Exception { boolean b;
b = canReadExtension("yourExtensionName");
b = canReadExtension("gif");
b = canReadExtension("giF");
} public static boolean canReadExtension(String fileExt) {
Iterator iter = ImageIO.getImageReadersBySuffix(fileExt); return iter.hasNext();
}