public function resize($width, $height = null)
 {
     if ($this->_imageShouldComeFromCloudinary($this->_getRequestedImageFile())) {
         $this->_dimensions = Dimensions::fromWidthAndHeight($width, $height ?: $width);
         return $this;
     }
     return parent::resize($width, $height);
 }
Beispiel #2
0
 public function resize($width, $height = null)
 {
     $p = Mage::getModel('catalog/product')->load($this->getProduct()->getId());
     if (!$p->getData('is_product_gift_enabled')) {
         return parent::resize($width, $height);
     }
     $type_img = $this->_getModel()->getDestinationSubdir();
     if ($type_img != 'small_image') {
         return parent::resize($width, $height);
     }
     parent::resize($width, $height);
     $w_w = (int) ($width / 4);
     $img_size = $w_w . 'x' . $w_w;
     $this->watermark('gift1e.png', 'bottom-right', $img_size, '100');
     return $this;
 }