Renders featured image of a post.

@param  int    $width
@param  int    $height
@param  string $defaultFeaturedImageURL The url of an image that should be returned if no featured image is found
@return HtmlString Returns featured image html
181852
public function printFeaturedImage($width = null, $height = null, $defaultFeaturedImageURL = '')
    {
        if($this->hasFeaturedImage()) {
            return new HtmlString(
                view()->make(
                    "vendor.posts.featuredImage", [
                    'imageURL' => $this->featuredImageURL($width, $height, $defaultFeaturedImageURL),
                    'featuredImage' => $this->featuredImage
                    ]
                )->render()
            );
        }
    }
314483
protected function urlForSize($width, $height=null)
    {

        if (!$this->sizes) {
            return $this->getUrl();
        }

        $targetSize = $width instanceof Size ? $width : new Size($width, $height);
        $targetKey = "$targetSize";

        if (isset($this->optimalSizeCache[$targetKey])) {
            return $this->optimalSizeCache[$targetKey];
        }

        $optimalSize = $targetSize->findBest($this->sizes());

        if ($this->getSize()->equals($optimalSize)) {
            $this->optimalSizeCache[$targetKey] = $this->getUrl();
            return $this->optimalSizeCache[$targetKey];
        }

        $optimalKey = "$optimalSize";

        if (isset($this->sizeUrls[$optimalKey])) {
            $this->optimalSizeCache[$targetKey] = $this->sizeUrls[$optimalKey];
            return $this->optimalSizeCache[$targetKey];
        }

        return $this->getUrl();

    }
693954
public function resize($width, $height) {
		$image = imagecreatetruecolor($width, $height);
		imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $this->width, $this->height);
		imagedestroy($this->_image);
		$this->_image = $image;
		return $this;
	}
1008906
protected function getNewHeight($width, $height) 
    {
        if ($height > 0) {
            return $height;
        }
        
        // original width : new width = original height : X
        return $width * $this->imageInfo['height'] / $this->imageInfo['width'];
    }
165344
public static function getInstanceByCreate($width, $height)
    {
        $instance = new self();

        // set image dimensions
        $instance->width = (int)$width;
        $instance->height = (int)$height;

        $instance->createImage();

        return $instance;
    }
737215
public function croppedResize($width, $height)
    {
        return $this->createCloneWithResource(
            function (InterventionImage $resource) use ($width, $height) {
                return $resource->fit($width, $height);
            }
        );
    }
1072018
public function resize($width, $height) {

        $new = @imagecreatetruecolor($width, $height);

        // This needed to deal with .png transparency
        imagealphablending($new, false);
        imagesavealpha($new, true);
        $transparent = imagecolorallocatealpha($new, 255, 255, 255, 127);
        imagefilledrectangle($new, 0, 0, $width, $height, $transparent);

        imagecopyresampled($new, $this->resource, 0, 0, 0, 0, $width, $height,
            $this->width(), $this->height());
        $this->resource = $new;

        // for method chaining
        return $this;
    }
698986
public function create($width = null, $height = null)
    {
        $this->width  = ($width)  ? $width : $this->width;
        $this->height = ($height) ? $height : $this->height;

        $imageType    = $this->getImageType();
        $createFunc   = ($imageType === 'gif') ? 'imagecreate' : 'imagecreatetruecolor';
        $this->image  = $createFunc($this->width, $this->height);

        $bgColor = $this->backgroundColor;

        $backgroundColor = imagecolorallocate($this->image, $bgColor[0], $bgColor[1], $bgColor[2]);

        imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, $backgroundColor);

        $this->drawText();

        if ($this->drawBorder)
        {
            $this->drawBorder();
        }

        if ($this->drawLine)
        {
            $this->drawLine();
        }

        if ($this->drawPixel)
        {
            $this->drawPixel();
        }

        return $this;
    }
331653
public static function getImage($id, $size = "moyen", $showDefault = true, $dimension = array('height'=>200,'width'=>200))
    {
        global $config;
        $req = "
            SELECT idImage
            FROM _personneImage
            WHERE idPersonne = '".mysql_real_escape_string($id)."'
        ";

        $res = $config->connexionBdd->requete($req);
        if ($fetch=mysql_fetch_object($res)) {
            $req = "
                SELECT dateUpload, idHistoriqueImage
                FROM historiqueImage
                WHERE idImage = '".$fetch->idImage."'
            ";
            $res = $config->connexionBdd->requete($req);
            $fetch = mysql_fetch_object($res);
            if (isset($fetch->idHistoriqueImage)) {
                if ($size=="resized") {
                    return "resizeImage.php?id=".$fetch->idHistoriqueImage."&height=".$dimension['height']."&width=".$dimension['width']."";
                }
                return $config->getUrlImage($size).$fetch->dateUpload.'/'.$fetch->idHistoriqueImage.'.jpg';
            }
        }
        if ($showDefault) {
            return "images/avatar/default.jpg";
        }

    }
728622
public function canvas($width, $height, $background = null)
    {
        return $this->createDriver()->newImage($width, $height, $background);
    }
1038335
private function actionThumbnail($name, $width, $height)
    {
        $target = $this->getThumbName($name);
        $image = clone $this->getPhpThumb();
        $image->resize($width, $height);
        $image->save($target);
        @chmod($target, 0666);
    }
968558
public function getAppIconTouchResized($width, $height)
    {
        if ($this->owner->AppIconTouch()->exists()) {
            return $this->owner->AppIconTouch()->ResizedImage($width, $height);
        }
    }
57648
public function newImage($width, $height, $background = 'white')
    {
        $this->resource->createNew($width, $height, $background);

        return $this;
    }
765490
public function process($url, $width = '', $height = '', $title = '', $options = [])
    {
        //If invalid URL passed, set to default image
        if (empty($url) || filter_var($url, FILTER_VALIDATE_URL) === false) {
            $url = $this->defaultImage;
        }

        $data = json_encode([
            'url' => $url,
            'width' => $width,
            'height' => $height,
            'default' => $this->defaultImage,
            'options' => array_merge($this->defaultOptions, $options)
        ]);

        $uri = base64_encode(json_encode([
            'data' => $data,
            'hash' => sha1($this->key.$this->secret.$data)
        ]));

        // Make the b64 string url-safe
        $uri = str_replace(['+', '/'], ['-', '_'], $uri);

        $fullUrl = [
            $this->host,
            $this->key,
            $uri,
            $this->filename($url, $title)
        ];

        return implode('/', $fullUrl);
    }
435667
public function image($image, $width=null, $height=null, $alt=null, $class=null, $link=null, $caption=null, $srcset=null) {
		$image = $this->getLink($image);
		$attributes = $this->getHtmlAttributes(array(
			'width'=>$width,
			'height'=>$height,
			'alt'=>$alt,
			'caption'=>$caption,
			'class'=>$class,
			'srcset'=>$srcset
		));

		$img = "<img src='$image'$attributes />";
		if (!is_null($link)) {
			$link = $this->getLink($link);
			return "<a href='$link'>$img</a>";
		}

		return $img;
	}
1082670
public function getURL($width = '', $height = '')
    {
        $uri = $this->getName();
        if ($height && $width) {
            return Settings::get('image_url').$width.'/'.$height.'/'.$uri;
        } elseif ($width) {
            return Settings::get('image_url').$width.'/'.$uri;
        } else { // original image
            return Settings::get('image_url').$uri;
        }
    }
1282806
public function placeholder($width = null, $height = null, $watermark = [])
    {
        return $this->resize(Config::get('admin.defaults.placeholder'), $width, $height, $watermark);
    }