Returns true if the specified file extension can be read
import java.io.File; import java.util.Iterator; import javax.imageio.ImageIO; 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(); } }