49 $this->_adapter->checkDependencies();
51 if (!file_exists($this->_fileName)) {
52 throw new \Exception(
"File '{$this->_fileName}' does not exist.");
55 $this->_adapter->open($this->_fileName);
66 $this->_adapter->display();
77 public function save($destination =
null, $newFileName =
null)
79 $this->_adapter->save($destination, $newFileName);
91 $this->_adapter->rotate($angle);
104 public function crop($top = 0, $left = 0, $right = 0, $bottom = 0)
106 $this->_adapter->crop($top, $left, $right, $bottom);
117 public function resize($width, $height =
null)
119 $this->_adapter->resize($width, $height);
130 return $this->_adapter->keepAspectRatio(
$value);
141 return $this->_adapter->keepFrame(
$value);
152 return $this->_adapter->keepTransparency(
$value);
163 return $this->_adapter->constrainOnly(
$value);
174 return $this->_adapter->backgroundColor(
$value);
185 return $this->_adapter->quality(
$value);
204 $watermarkImageOpacity = 30,
207 if (!file_exists($watermarkImage)) {
208 throw new \Exception(
"Required file '{$watermarkImage}' does not exists.");
210 $this->_adapter->watermark($watermarkImage, $positionX, $positionY, $watermarkImageOpacity, $repeat);
221 return $this->_adapter->getMimeType();
232 return $this->_adapter->getImageType();
265 $this->_adapter->imageBackgroundColor = intval($color);
276 $this->_adapter->setWatermarkPosition($position);
288 $this->_adapter->setWatermarkImageOpacity($imageOpacity);
300 $this->_adapter->setWatermarkWidth($width);
312 $this->_adapter->setWatermarkHeight($height);
323 return $this->_adapter->getOriginalWidth();
333 return $this->_adapter->getOriginalHeight();
345 $this->_adapter->createPngFromString(
$text, $font);
setImageBackgroundColor($color)
setWatermarkImageOpacity($imageOpacity)
setWatermarkWidth($width)
setWatermarkPosition($position)
resize($width, $height=null)
setWatermarkHeight($height)
__construct(\Magento\Framework\Image\Adapter\AdapterInterface $adapter, $fileName=null)
watermark( $watermarkImage, $positionX=0, $positionY=0, $watermarkImageOpacity=30, $repeat=false)
save($destination=null, $newFileName=null)
createPngFromString($text, $font='')
crop($top=0, $left=0, $right=0, $bottom=0)