def is_direct_image_link(url):
    """Return whether the url is a direct link to an image."""
    image_extensions = ('jpg', 'jpeg', 'png', 'gif', 'apng', 'tiff', 'bmp')
    return url.rpartition('.')[-1].lower() in image_extensions