Exemplo n.º 1
0
 public function perform(Zend_Image_Adapter_AdapterAbstract $adapter)
 {
     if (!$this->flop() && !$this->flip()) {
         require_once 'Zend/Image/Exception.php';
         throw new Zend_Image_Exception('No axis specified to mirror');
     }
     return parent::perform($adapter);
 }
Exemplo n.º 2
0
 public function perform(Zend_Image_Adapter_AdapterAbstract $adapter)
 {
     $newX = $this->getXAmount();
     $newY = $this->getYAmount();
     if (null === $newX && null === $newY) {
         throw new Zend_Image_Action_Exception('No dimensions for resizing were specified, ' . 'at least one dimension should be specified.');
     }
     $constrain = $this->hasConstrainedProportions();
     if (null === $newX) {
         if ($constrain) {
             $newX = 0;
         } else {
             $newX = $adapter->getWidth();
         }
     } elseif (self::TYPE_RELATIVE == $this->getXType()) {
         $newX *= $adapter->getWidth() / 100;
     }
     if (null === $newY) {
         if ($constrain) {
             $newY = 0;
         } else {
             $newY = $adapter->getHeight();
         }
     } elseif (self::TYPE_RELATIVE == $this->getYType()) {
         $newY *= $adapter->getHeight() / 100;
     }
     $this->_yAmountCalculated = $newY;
     $this->_xAmountCalculated = $newX;
     return parent::perform($adapter);
 }