Skip to content

Commit

Permalink
Move config image opacity cast to setWatermarkImageOpacity method (Op…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz-Silpion committed Jan 10, 2024
1 parent 29e91f7 commit c982305
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/code/core/Mage/Catalog/Helper/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function init(Mage_Catalog_Model_Product $product, $attributeName, $image
Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_image")
);
$this->setWatermarkImageOpacity(
(int) Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_imageOpacity")
Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_imageOpacity")
);
$this->setWatermarkPosition(
Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_position")
Expand Down Expand Up @@ -488,12 +488,12 @@ protected function getWatermarkSize()
/**
* Set watermark image opacity
*
* @param int $imageOpacity
* @param int|string $imageOpacity
* @return $this
*/
public function setWatermarkImageOpacity($imageOpacity)
{
$this->_watermarkImageOpacity = $imageOpacity;
$this->_watermarkImageOpacity = (int) $imageOpacity;
$this->_getModel()->setWatermarkImageOpacity($imageOpacity);
return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Catalog/Model/Product/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -693,12 +693,12 @@ public function getWatermarkPosition()
/**
* Set watermark image opacity
*
* @param int $imageOpacity
* @param int|string $imageOpacity
* @return $this
*/
public function setWatermarkImageOpacity($imageOpacity)
{
$this->_watermarkImageOpacity = $imageOpacity;
$this->_watermarkImageOpacity = (int) $imageOpacity;
return $this;
}

Expand Down

0 comments on commit c982305

Please sign in to comment.