Exemple #1
0
 private static function generateThumb($path, $name, $width, $heigth)
 {
     $save = self::$path . DIRECTORY_SEPARATOR . $name;
     $thumb = \Canvas::Instance();
     $thumb->carrega($path);
     $thumb->redimensiona($width, $heigth, 'crop');
     $thumb->grava($save);
 }
Exemple #2
0
 /**
  * Executa o upload do arquivo
  * @return boolean
  */
 public function execute()
 {
     $this->width = \Local\Config::$cms_image_width;
     $this->height = \Local\Config::$cms_image_heigth;
     if (\Local\Config::$cms_image_size_reverse_direction) {
         if ($this->info[0] < $this->info[1]) {
             $this->width = \Local\Config::$cms_image_heigth;
             $this->height = \Local\Config::$cms_image_width;
         }
     }
     $upload = \Canvas::Instance(parent::getTmpName());
     $upload->redimensiona($this->width, $this->height, \Local\Config::$cms_image_type);
     return $upload->grava($this->detination);
 }