public static boolean hasImageFileExtension(final File file) {
        if (file == null || !file.isFile()) {
            return false;
        }
        return hasImageFileExtension(file.getName());
    }
Attempts to determine if a file contains an image recorded in a supported graphics format based on its file-name extension (for example "&#46;jpg",
"&#46;gif", "&#46;png", etc&#46;).

@param file A valid File object providing a reference to a file that may contain an image.
@return true if the file-name includes a supported image format file extension; otherwise, false.
src/main/java/org/apache/commons/imaging/Imaging.java