Exemplo n.º 1
0
 public function testSetAndGetHeight()
 {
     $this->imageFile->setHeight(33);
     self::assertEquals(33, $this->imageFile->getHeight());
     $this->imageFile->setHeight(45);
     self::assertEquals(45, $this->imageFile->getHeight());
 }
 private function scaleEnlarge($maxwidth, $maxheight)
 {
     $inputWidth = $this->input->getWidth();
     $inputHeight = $this->input->getHeight();
     if ($this->allowEnlargement && $inputWidth < $maxwidth && $inputHeight < $maxheight) {
         // allow enlargements
         if ($maxwidth - $inputWidth > $maxheight - $inputHeight) {
             //enlarge according to height
             $new_height = $maxheight;
             $new_width = $new_height * $inputWidth / $inputHeight;
         } else {
             //enlarge accoring to width
             $new_width = $maxwidth;
             $new_height = $new_width * $inputHeight / $inputWidth;
         }
         return array(round($new_width), round($new_height));
     } else {
         return array($inputWidth, $this->input->getHeight());
     }
 }