Example #1
0
 /**
  * Calculates the new image dimensions
  * 
  * These calculations are based on both the provided dimensions and $this->maxWidth and $this->maxHeight
  * 
  * @param int $width
  * @param int $height
  */
 protected function calcImageSize($width, $height)
 {
     parent::calcImageSize($width, $height);
     if ($this->newDimensions['newWidth'] == 0) {
         $this->newDimensions['newWidth'] = 1;
     }
     if ($this->newDimensions['newHeight'] == 0) {
         $this->newDimensions['newHeight'] = 1;
     }
     return $this->newDimensions;
 }
Example #2
0
 public function testGetStreamWrapper()
 {
     $imageCreator = new GdThumb();
     $imageCreator->setStreamWrapper(new File());
     $this->assertAttributeInstanceOf('Deepzoom\\StreamWrapper\\File', '_streamWrapper', $imageCreator);
     $this->assertInstanceOf('Deepzoom\\StreamWrapper\\File', $imageCreator->getStreamWrapper());
 }