def getWebImgType_file(filename):
    """
    Get image file type of an image stored in disk. Can be used to verify if an image is available for web.
    :param filename: The file you want to verify.
    :return: Image file type. If image is invalid, returns False.
    """
    data = open(filename,'rb').read(11)

    # JPG
    if data[:4] == b'\xff\xd8\xff\xe0' and data[6:11] == b'JFIF\x00':
        return 'JPEG'
    # PNG
    if data[:6] == b'\x89PNG\r\n':
        return 'PNG'
    # GIF
    if data[:3] == b'\x47\x49\x46\x38':
        return 'GIF'

    # Format not recognised
    return False