def getBestTextureFormat(ext_list, extensions):
    """
    returns index to a texture from tex_list which has the highest priority in ext_list
    if none of texture extensions is in ext_list, will return None
    
    ext_list
        is list of extensions in ascending order (the latter, the higher priority), e.g.:
        ["jpg", "tif", "png", "exr", "rat"]
    """    
    idx = -1
    for ext in ext_list:
        if ext.lower() in extensions:
            idx = extensions.index(ext)
    
    if idx != -1:
        return idx
    else:
        return None