def load_url(self, url, filter=None): """Load from a URL. .. versionadded:: 0.7.1 """ response = get_url(url) stream = BytesIO(response.content) self.load_image(stream, filter=filter)
def load_urls(self, urls): """Load from URLs. .. versionadded:: 0.7.1 """ url_dict = {} for idx, url in enumerate(urls): response = get_url(url) url_dict[idx] = BytesIO(response.content) imgs = [item for item in url_dict.values()] self.load_images(imgs, names=urls)