public addOverlayFit ( $image, string $composite = "COMPOSITE_DEFAULT" ) : |
||
$image | ||
$composite | string | |
return |
public function addOverlayFit($image, $composite = "COMPOSITE_DEFAULT")
{
$image = PIMCORE_DOCUMENT_ROOT . "/" . ltrim($image, "/");
if (is_file($image)) {
//if a specified file as a overlay exists
$overlayImage = $this->createTmpImage($image, 'overlay');
$overlayImage->resize($this->getWidth(), $this->getHeight())->save($overlayImage->getOutputPath());
$this->processOverlay($overlayImage, $composite);
}
return $this;
}