@param string $smallImageUrl
@param string $largeImageUrl

@return CardImage
326389
public static function fromUrls(string $smallImageUrl, string $largeImageUrl): self
    {
        $cardImage = new self();

        $cardImage->smallImageUrl = $smallImageUrl;
        $cardImage->largeImageUrl = $largeImageUrl;

        return $cardImage;
    }
1025800
private static function imageIsValid(Url $url, Url $baseUrl, $externalImages)
    {
        //base64 or same domain
        if ($url->getContent() !== null || $url->getDomain() === $baseUrl->getDomain()) {
            return true;
        }

        return is_bool($externalImages) ? $externalImages : $url->match($externalImages);
    }
1312927
public function displayImage($string, $size = 64, $color = null, $backgroundColor = null)
    {
        $imageData = $this->getImageData($string, $size, $color, $backgroundColor);

        return Response::make($imageData, 200, ['Content-Type' => 'image/png']);
    }
386322
public static function touchRemoteFile($imageUrl)
    {
        // Get cURL resource
        $curl = curl_init($imageUrl);
        if (!$curl) {
            return false;
        }
        // Set some options - we are passing in a useragent too here
        curl_setopt_array($curl, array(
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_URL => $imageUrl,
            CURLOPT_USERAGENT => 'Splash cURL Agent'
        ));
        // Send the request & save response to $resp
        $resp = curl_exec($curl);
        // Close request to clear up some resources
        curl_close($curl);

        return (false != $resp);
    }
1007174
public function setImage($imageUrl)
    {
        $this->openGraph()->setImage($imageUrl);
        $this->twitter()->addImage($imageUrl);

        return $this;
    }
456711
private String formatUrl(String imageUrl) {
		if (useProxy || null != authentication || useCache) {
			String token = securityContext.getToken();
			if (null != token) {
				StringBuilder url = new StringBuilder(imageUrl);
				int pos = url.lastIndexOf("?");
				if (pos > 0) {
					url.append("&");
				} else {
					url.append("?");
				}
				url.append("userToken=");
				url.append(token);
				return url.toString();
			}
		}
		return imageUrl;
	}
722042
public function updateURL(&$url) {
		if($this->owner instanceof \Image_Cached || $this->owner instanceof \CdnImage_Cached) {
			return; /** handled in @link ImageCachedExtension */
		}

        // in the CMS, we do _not_ change the asset
        $controller = Controller::has_curr() ? Controller::curr() : null;
        if ($controller instanceof LeftAndMain) {
            return;
        }

        if ($this->owner->CanViewType && $this->owner->getViewType() != CDNFile::ANYONE_PERM) {
            return;
        }

        $cdnLink = $this->getCdnLink();
        if ($cdnLink) {
            $url = $cdnLink;
        }
	}
1158421
private function addBaseurl2ImageSource(&$filtered, $baseurl)
    {
        $textf  = $this->di->get("textfilter");
        $url    = $this->di->get("url");

        // Use callback to url->create() instead of string concat
        $callback = function ($route) use ($url, $baseurl) {
            return $url->asset($route, $baseurl);
        };

        $filtered->text =
            $textf->addBaseurlToImageSource($filtered->text, $baseurl, $callback);
    }
407532
public function getUrl($image, $imageQuery = NULL)
    {
        // Experimental support for absolute picture url when is relative generator url set
        if($imageQuery && Strings::startsWith($imageQuery, '//'))
        {
            $imageQuery = Strings::substring($imageQuery, 2);
            $imageUrl   = $this->getPictureGeneratorUrl($image, $imageQuery);

            if($this->isUrlRelative)
            {
                if($this->websiteUrl)
                {
                    return $this->websiteUrl . $imageUrl;
                }
                else
                {
                    return '//' . $_SERVER['SERVER_ADDR'] . $imageUrl;
                }
            }
            else
            {
                return $imageUrl;
            }
        }

        return $this->getPictureGeneratorUrl($image, $imageQuery);
    }
817196
public URL createImageUrl(String imagePath, String requiredSize) throws MovieDbException {
        return tmdbConfiguration.getConfig().createImageUrl(imagePath, requiredSize);
    }
690660
protected function getResizedImageUrl()
    {
        $imageUrl = "";

        if ($this->getResizedImagePath()) {
            $imageUrl = $this->getImageDirUrl() . $this->getResizedImageName();
        }

        return $imageUrl;
    }
1145698
public function createImageFromUrl($url)
    {
        $file = wei()->file->downloadOnDemand($url);
        $file = file_get_contents($file);

        return imagecreatefromstring($file);
    }
436775
function(url, img) {
        var svgImage = document.createElementNS(SVG_NS_URL, 'image');
        svgImage.setAttributeNS(XLINK_NS_URL, 'xlink:href', url);
        svgImage.setAttribute('x', 0);
        svgImage.setAttribute('y', 0);
        svgImage.setAttribute('width', img.width);
        svgImage.setAttribute('height', img.height);
        return svgImage;
      }
130205
def download_large(self, image, url_field='url'):
        
        return self.download(image, url_field=url_field, suffix='large')
1108664
public function image($width = null, $height = null, array $options = [])
    {
        $url = $this->getImageUrlOrDefault();

        if (pathinfo($url, PATHINFO_EXTENSION) === 'svg') {
            return $url;
        }

        return url(Croppa::url($url, $width, $height, $options));
    }
1289707
def img_src(url, class_="", responsive=False, lazy_load=False, id_=""):
    
    if not url.startswith("http://") and not url.startswith("https://"):
        url = static_url(url)

    data_src = ""
    if responsive:
        class_ += " responsive"
    if lazy_load:
        data_src = url
        # 1x1 image
        url = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNgYAAAAAMAASsJTYQAAAAASUVORK5CYII="
        class_ += " lazy"

    img = "<img src=\"{src}\" class=\"{class_}\" id=\"{id_}\" data-src={data_src}>" \
        .format(src=url, class_=class_, id_=id_, data_src=data_src)
    return Markup(img)
245187
public function generateShortUrl(Http\ImageUrl $imageUrl) {
        $transformations = $imageUrl->getTransformations();

        if ($transformations) {
            $transformations = '?t[]=' . implode('&t[]=', $transformations);
        } else {
            $transformations = null;
        }

        $params = array(
            'user' => $this->getUser(),
            'imageIdentifier' => $imageUrl->getImageIdentifier(),
            'extension' => $imageUrl->getExtension(),
            'query' => $transformations,
        );

        return $this->getCommand('GenerateShortUrl', array(
            'user' => $this->getUser(),
            'imageIdentifier' => $imageUrl->getImageIdentifier(),
            'params' => json_encode($params),
        ))->execute();
    }