Url for direct jpg use.
426388
def source_url(farm, server, id, secret, size):
    '''  '''
    if size == 'small':
        img_size = 'n'
    elif size == 'medium':
        img_size = 'c'
    elif size == 'large':
        img_size = 'b'

    return 'https://farm{}.staticflickr.com/{}/{}_{}_{}.jpg'.format(
        farm, server, id, secret, img_size)
836625
def url_for(**options):
    ''''''

    url_parts = get_url_parts(**options)
    image_hash = hashlib.md5(b(options['image_url'])).hexdigest()
    url_parts.append(image_hash)

    return "/".join(url_parts)
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)
894549
def _download_images(data, img_cols):
  """"""

  images = collections.defaultdict(list)
  for d in data:
    for img_col in img_cols:
      if d.get(img_col, None):
        if isinstance(d[img_col], Image.Image):
          # If it is already an Image, just copy and continue.
          images[img_col].append(d[img_col])
        else:
          # Otherwise it is image url. Load the image.
          with file_io.FileIO(d[img_col], 'rb') as fi:
            im = Image.open(fi)
          images[img_col].append(im)
      else:
        images[img_col].append('')

  return images
894847
def get_small_image_url(self, page=1):
        
        template = self.resources.page.get('image')
        return template.replace(
            "{page}",
            str(page)
        ).replace("{size}", "small")
215129
function downloadImage(map) {
    map.exportAsImage(function (url) {
        let a = document.createElement("a");
        a.download = "example";
        a.href = url;
        a.click();
    }, "jpeg");
}
130021
def image_absoulte_path(self, url, image):
        """"""
        if not re.match(re_http, image):
            topimage = urljoin(url, image)
            return topimage
        return image
1325164
def renderThumbnail(self, relpath=""):
        """"""
        # no thumbnail -- return empty string
        if self.thumbnail is None:
            return ""
        # else thumbnail is same as full image (because image was small enough), insert directly
        elif self.thumbnail is self.fullimage:
            fname = relpath + self.fullimage
            return """<IMG SRC="%s" ALT="%s"></IMG>""" % (quote_url(fname), quote_url(os.path.basename(self.filename)))
        # else return thumbnail linking to full image
        else:
            tname = relpath + self.thumbnail
            fname = relpath + self.fullimage
            return """<A HREF="%s"><IMG SRC="%s" ALT="%s"></A>""" % (
            quote_url(fname), quote_url(tname), quote_url(os.path.basename(self.filename)))
651042
def image_url(self, pixel_size=None):
        
        if "profile" not in self._raw:
            return
        profile = self._raw["profile"]
        if (pixel_size):
            img_key = "image_%s" % pixel_size
            if img_key in profile:
                return profile[img_key]
        return profile[self._DEFAULT_IMAGE_KEY]
497584
function getPhotoUrl(data) {
    return FLICK_PHOTO_URL_TEMPLATE
        .replace('{farm-id}', data.farm)
        .replace('{server-id}', data.server)
        .replace('{id}', data.id)
        .replace('{secret}', data.secret)
        .replace('{size}', 'm');
}
1234439
function createPhotoUrl(id, farm, server, secret, size) {
		size = (size) ? '_' + size : '';
		return 'https://farm' + farm + '.staticflickr.com/' + server + '/' + id + '_' + secret + size + '.jpg';
	}
220260
function(mimeType, quality) {
            try {
                // If this call fails (due to browser bug, like in Firefox 3.6),
                // then revert to previous no-parameter image/png behavior
                return this._canvas.toDataURL(mimeType, quality);
            }
            catch(e) {
                try {
                    return this._canvas.toDataURL();
                }
                catch(err) {
                    Kinetic.Util.warn('Unable to get data URL. ' + err.message);
                    return '';
                }
            }
        }
611271
function toDataURL (image, options) {
  var src = '';
  var async, callback;

  options = options || {};

  async = typeof options.callback === 'function';

  callback = async ? options.callback : function (err, data) {
    if (err) {
      throw err;
    }
    return data;
  };

  function _convert (err, img) {
    if (err) {
      return callback(err);
    }
    var result;
    cors(img);
    result = convert(img, options.width, options.height);
    return callback(null, (options.purify ? purify(result) : result));
  }

  if (isImage(image)) {
    src = image.src || '';
  } else if (typeof image === 'string') {
    if (!async) {
      return callback(new Error('the url mode should be called with a callback'));
    }
    src = image;
  } else {
    return callback(new Error('image should be an Image Object or a string'));
  }

  return async ? createImage(src, _convert) : _convert(null, image);
}
837202
def _build_image_url(self, monitor, mode) -> str:
        """"""
        query = urlencode({
            'mode': mode,
            'buffer': monitor['StreamReplayBuffer'],
            'monitor': monitor['Id'],
        })
        url = '{zms_url}?{query}'.format(
            zms_url=self._client.get_zms_url(), query=query)
        _LOGGER.debug('Monitor %s %s URL (without auth): %s',
                      monitor['Id'], mode, url)
        return self._client.get_url_with_auth(url)
902224
def _image_url(image, dst_color=None, src_color=None):
    
    if src_color and dst_color:
        if not Image:
            raise Exception("Images manipulation require PIL")
    file = StringValue(image).value
    path = None
    if callable(STATIC_ROOT):
        try:
            _file, _storage = list(STATIC_ROOT(file))[0]
            d_obj = _storage.modified_time(_file)
            filetime = int(time.mktime(d_obj.timetuple()))
            if dst_color:
                path = _storage.open(_file)
        except:
            filetime = 'NA'
    else:
        _path = os.path.join(STATIC_ROOT, file)
        if os.path.exists(_path):
            filetime = int(os.path.getmtime(_path))
            if dst_color:
                path = open(_path, 'rb')
        else:
            filetime = 'NA'
    BASE_URL = STATIC_URL
    if path:
        src_color = tuple(int(round(c)) for c in ColorValue(
            src_color).value[:3]) if src_color else (0, 0, 0)
        dst_color = [int(round(c)) for c in ColorValue(dst_color).value[:3]]

        file_name, file_ext = os.path.splitext(
            os.path.normpath(file).replace('\\', '_').replace('/', '_'))
        key = (filetime, src_color, dst_color)
        key = file_name + '-' + base64.urlsafe_b64encode(
            hashlib.md5(repr(key)).digest()).rstrip('=').replace('-', '_')
        asset_file = key + file_ext
        asset_path = os.path.join(ASSETS_ROOT, asset_file)

        if os.path.exists(asset_path):
            file = asset_file
            BASE_URL = ASSETS_URL
            filetime = int(os.path.getmtime(asset_path))
        else:
            image = Image.open(path)
            image = image.convert("RGBA")
            pixdata = image.load()
            for y in xrange(image.size[1]):
                for x in xrange(image.size[0]):
                    if pixdata[x, y][:3] == src_color:
                        new_color = tuple(dst_color + [pixdata[x, y][3]])
                        pixdata[x, y] = new_color
            try:
                image.save(asset_path)
                file = asset_file
                BASE_URL = ASSETS_URL
            except IOError:
                log.exception("Error while saving image")
    url = 'url("%s%s?_=%s")' % (BASE_URL, file, filetime)
    return StringValue(url)
1242753
def media_image_url(self):
        """"""
        if self.is_nowplaying:
            base = self.server.construct_url(API_URL)
            try:
                image_id = self.session['NowPlayingItem']['ImageTags']['Thumb']
                image_type = 'Thumb'
            except KeyError:
                try:
                    image_id = self.session[
                        'NowPlayingItem']['ImageTags']['Primary']
                    image_type = 'Primary'
                except KeyError:
                    return None
            url = '{0}/Items/{1}/Images/{2}?width=500&tag={3}&api_key={4}'.format(
                base, self.media_id, image_type, image_id, self.server.api_key)
            return url
        else:
            return None
228997
def generate_image_from_url(url=None, timeout=30):
    

    file_name = posixpath.basename(url)
    img_tmp = NamedTemporaryFile(delete=True)

    try:
        response = requests.get(url, timeout=timeout)
        response.raise_for_status()
    except Exception as e:  # NOQA
        return None, None

    img_tmp.write(response.content)
    img_tmp.flush()

    image = File(img_tmp)
    image.seek(0)

    return file_name, image