Ejemplo n.º 1
0
 /**
  * Switch by available actions
  *
  * @param string $action	action to perform
  * @param string $source	source file
  * @param string $destination	destination file
  * @param array	 $limits	data to perform the action
  * @return  boolean
  */
 private static function set_action($action, $source, $destination, $limits)
 {
     // actions
     switch ($action) {
         case 'CROP':
             $check = X4Files_helper::create_cropped($source, $destination, $limits);
             break;
         case 'RESIZE':
             $check = X4Files_helper::create_resized($source, $destination, $limits, true, true);
             break;
         case 'SCALE':
             $check = X4Files_helper::create_resized($source, $destination, $limits, false);
             break;
         case 'FIT':
             $check = X4Files_helper::create_fit($source, $destination, $limits, true);
             break;
         default:
             $check = 1;
     }
     return $check;
 }