:return: URL of the image to use in OG shares
432330
def get_og_image_url(self):
        
        li = self.get_list_image()
        if li:
            from easy_thumbnails.files import get_thumbnailer
            thumb_url = get_thumbnailer(li)['og_image'].url
            # TODO: looks like this may fail if SITE_DOMAIN = "acmi.lvh.me"
            return urljoin(settings.SITE_DOMAIN, thumb_url)
230595
def imageurl(self):
        
        if self._imageurl is None:
            self._imageurl = 'http://www.chemspider.com/ImagesHandler.ashx?id=%s' % self.csid
        return self._imageurl
1278740
def _get_thumbnail_url(image):
    
    lhs, rhs = splitext(image.url)
    lhs += THUMB_EXT
    thumb_url = f'{lhs}{rhs}'
    return thumb_url
774836
def logo_as_data_uri(self):
        """"""
        _, ext = os.path.splitext(self.logo.file.name)
        with open(self.logo.file.name, 'rb') as f:
            data = base64.b64encode(f.read())

        return 'data:image/{};base64,{}'.format(
            ext[1:],  # Remove the leading dot.
            data.decode()
        )
439146
def get_image_uri(region_name, repo_name, repo_version=1):
    """"""
    repo = '{}:{}'.format(repo_name, repo_version)
    return '{}/{}'.format(registry(region_name, repo_name), repo)
841791
def image(self, s=0, c=0, z=0, t=0):
        
        return self.proxy_image(s=s, c=c, z=z, t=t).image
726185
def _get_image_url(self, image_id):
        
        gce = self._connect()
        filter = "name eq %s" % image_id
        request = gce.images().list(project=self._project_id, filter=filter)
        response = self._execute_request(request)
        response = self._wait_until_done(response)

        image_url = None
        if "items" in response:
            image_url = response["items"][0]["selfLink"]

        if image_url:
            return image_url
        else:
            raise ImageError("Could not find given image id `%s`" % image_id)
923436
def get_thumbnail_image_url(self, page=1):
        
        template = self.resources.page.get('image')
        return template.replace(
            "{page}",
            str(page)
        ).replace("{size}", "thumbnail")
116312
def _link_to_img(self):
        
        # make sure options are valid
        if self.rating.lower() not in RATINGS:
            raise InvalidRatingError(self.rating)
        if not (MIN_SIZE <= self.size <= MAX_SIZE):
            raise InvalidSizeError(self.size)
        
        url = ''
        if self.secure:
            url = SECURE_BASE_URL
        else:
            url = BASE_URL

        options = {'s' : self.size, 'r' : self.rating}
        if self.default is not None:
            options['d'] = self.default
        url += self.hash + '?' + urlencode(options)
        return url
497653
def get_uri(self):
    ''' 
    '''
    if hasattr(self, 'simage'):
        if self.simage is not None:
            if self.simage.image not in ['', None]:
                # Concatenates the <uri>://<image>
                return str(self.simage)
855311
def public_url(self):
        
        return "{storage_base_url}/{bucket_name}/{quoted_name}".format(
            storage_base_url=_API_ACCESS_ENDPOINT,
            bucket_name=self.bucket.name,
            quoted_name=quote(self.name.encode("utf-8")),
        )
791513
def download_image(url: str = '', save_path: str = '',
                   unverified_ctx: bool = False) -> Union[None, str]:
    
    if unverified_ctx:
        ssl._create_default_https_context = ssl._create_unverified_context

    if url:
        image_name = url.rsplit('/')[-1]

        splitted_name = image_name.rsplit('.')
        if len(splitted_name) < 2:
            image_name = '{}.jpg'.format(uuid4())
        else:
            image_name = '{}.{}'.format(uuid4(), splitted_name[-1])
        full_image_path = path.join(save_path, image_name)
        request.urlretrieve(url, full_image_path)
        return full_image_path
    return None
836767
def image(self):
        
        return self._uid.image.image if isinstance(self._uid, UserAttribute) else None
1294674
def image_url(self):
        """"""
        return construct_api_url(self.input, 'image', self.resolvers, False, self.get3d, False, **self.kwargs)
381567
def image_url(*arguments, &block)
      options = arguments.extract_options!
      new_image, size, content_type = arguments

      block = proc { without_digest_asset_url(new_image) } if options[:digested] == false && block_given? == false

      # TODO: add another class for storing image
      attributes[:image] = store_value(new_image, &block)

      # add size and content type for block value
      size, content_type = new_image, size if block_given?

      attributes[:image_size] = store_value(size.split("x").map(&:to_i)) if size
      attributes[:image_content_type] = store_value(content_type) if content_type
    end
168694
def url(name = nil)
      if name
        if version_identifiers.include?(name.to_s)
          self[:@versions][name.to_s][:@url]
        else
          raise "Invalid Image Version identifier: '#{name}' (must be #{version_identifiers.join(', ')})"
        end
      else
        self[:@url]
      end
    end
97817
def sponsor_image_url(sponsor, name):
    """"""
    if sponsor.files.filter(name=name).exists():
        # We avoid worrying about multiple matches by always
        # returning the first one.
        return sponsor.files.filter(name=name).first().item.url
    return ''