(filename)
return any(filename_lower.endswith(ext) for ext in IMG_EXTENSIONS)
Checks if a file is an image.

    Args:
        filename (string): path to a file

    Returns:
        bool: True if the filename ends with a known image extension
Checks if a file is an image.
Checks if a file is an image .
def is_image_file(filename):
    """Checks if a file is an image.

    Args:
        filename (string): path to a file

    Returns:
        bool: True if the filename ends with a known image extension
    """
    filename_lower = filename.lower()
    return any(filename_lower.endswith(ext) for ext in IMG_EXTENSIONS)
def is_image_file ( filename ) : filename_lower = filename . lower ( ) return any ( filename_lower . endswith ( ext ) for ext in IMG_EXTENSIONS )