Esempio n. 1
0
 /**
  * Get metadata from thumbnail image file and load it into class variables.
  * Some of the data is ignored.
  */
 protected function applyFileInfo()
 {
     $info = @getimagesize($this->getFileSystemPath());
     if ($info) {
         list($this->width, $this->height) = $info;
         if (array_key_exists("mime", $info)) {
             $this->mimetype = $info["mime"];
         }
         $this->realHeight = $this->height;
         $this->realWidth = $this->width;
         if ($this->config && $this->config->getHighResolution() && $this->config->getHighResolution() > 1) {
             $this->width = floor($this->width / $this->config->getHighResolution());
             $this->height = floor($this->height / $this->config->getHighResolution());
         }
     }
 }
Esempio n. 2
0
 /**
  * Get a thumbnail image configuration.
  * @param mixed $selector Name, array or object describing a thumbnail configuration.
  * @return Thumbnail\Config
  */
 protected function createConfig($selector)
 {
     return Thumbnail\Config::getByAutoDetect($selector);
 }