示例#1
0
 /**
  * Test image properties
  *
  * @return void
  */
 public function testImageProperties()
 {
     $picture = new Viewer\Picture($this->_conf, $this->_series->getRepresentative(), null);
     $width = $picture->getWidth();
     $height = $picture->getHeight();
     $isPyramidal = $picture->isPyramidal();
     $fpath = $picture->getFullPath();
     $vformats = $picture->getVisibleFormats();
     $url = $picture->getUrl(null);
     $surl = $picture->getUrl(null, 'default');
     $name = $picture->getName();
     $this->integer($width)->isEqualTo(150);
     $this->integer($height)->isEqualTo(200);
     $this->boolean($isPyramidal)->isFalse();
     $this->string($fpath)->isIdenticalTo($this->_roots[0] . '/doms.jpg');
     $this->string($name)->isIdenticalTo('doms.jpg');
     $this->array($vformats)->hasSize(1);
     $this->string($url)->isIdenticalTo('/show/default/doms.jpg');
     $this->string($surl)->isIdenticalTo('/show/default/doms.jpg');
     $picture = new Viewer\Picture($this->_conf, DEFAULT_PICTURE, null);
     $width = $picture->getWidth();
     $height = $picture->getHeight();
     $isPyramidal = $picture->isPyramidal();
     $fpath = $picture->getFullPath();
     $vformats = $picture->getVisibleFormats();
     $url = $picture->getUrl(null);
     $surl = $picture->getUrl(null, 'default');
     $name = $picture->getName();
     $this->integer($width)->isEqualTo(3090);
     $this->integer($height)->isEqualTo(4277);
     $this->boolean($isPyramidal)->isFalse();
     $this->string($fpath)->isIdenticalTo(WEB_DIR . '/images/' . DEFAULT_PICTURE);
     $this->string($name)->isIdenticalTo(DEFAULT_PICTURE);
     $this->array($vformats)->hasSize(3);
     $this->string($url)->isIdenticalTo('/show/default/main.jpg');
     $this->string($surl)->isIdenticalTo('/show/default/main.jpg');
 }
示例#2
0
 /**
  * Get list of cseries thumbnails
  *
  * @param array $fmt Thumbnail format form configuration
  *
  * @return array
  */
 public function getThumbs($fmt)
 {
     $ret = array();
     $thumbs = array();
     $ret['meta'] = $fmt;
     foreach ($this->_content as $c) {
         $p = new Picture($this->_conf, $c, null, $this->_full_path);
         $path = null;
         if ($p->isPyramidal()) {
             $path = $p->getFullPath();
         } else {
             $path = $c;
         }
         $thumbs[] = array('name' => $c, 'path' => $path);
     }
     $ret['thumbs'] = $thumbs;
     return $ret;
 }