Example #1
0
 public function thumb()
 {
     Yii::import('fbgallery.drivers.Image');
     $quality = $this->conf->quality;
     $sharpen = $this->conf->sharpen;
     $imgWidth = $this->conf->imgWidth;
     $thWidth = $this->conf->thWidth;
     //create an array with filenames of files uploaded in tmp folder
     $arrFiles = MyFiles::filesFromDir($this->path->tmp);
     //select the type of resizing
     switch ($this->conf->thumbStyle) {
         case 'square':
             self::square($arrFiles, $quality, $sharpen, $imgWidth, $thWidth);
             break;
         case 'landscape':
             self::landscape($arrFiles, $quality, $sharpen, $imgWidth, $thWidth);
             break;
         case 'portrait':
             self::portrait($arrFiles, $quality, $sharpen, $imgWidth, $thWidth);
             break;
     }
     //after successful create thumbnail, we go to add new pictures filename in database
     operations::addImagesToDB($arrFiles);
 }