function getValue($filtered = true)
 {
     if ($this->_saving_path == '' || $this->_saving_value == '') {
         return '';
     }
     $substitutions = array();
     $path = $this->saveFileAs($this->_saving_path, 0644, $substitutions);
     if (!$path) {
         return '';
     }
     $value = str_replace(array_keys($substitutions), array_values($substitutions), PathHelper::replaceUploadsDir($this->_saving_value));
     if ($this->_filter && $filtered) {
         $value = call_user_func($this->_filter, $value, $this->getName());
     }
     return $value;
 }
 /**
  *
  * @example
  * 
  * $this->createThumbs(
  * 		array('best',	'[programa]/{random[10]}_{width}x{height}.{ext}'	300, 500),
  *		array('width',	'[programa]/{random[10]}_width.{ext}',	110),
  * 		array('square', '[programa]/{random[10]}_square.{ext}',	80),
  * 		array('crop', 	'[programa]/{random[10]}_crop_{width}x{height}.{ext}',	300, 500),
  * 		array('height',	'[programa]/{random[10]}_height.{ext}',	180),
  * 		array('filled', '[programa]/{random[10]}_filled.{ext}',	365),
  *		array('original','[programa]/{random[10]}.{ext}')
  * 	);
  *
  * @return array
  */
 function createThumbs()
 {
     if (!$this->hasFile()) {
         return false;
     }
     $thumbs = func_get_args();
     #No thumbs specified
     if (!count($thumbs)) {
         return false;
     }
     #Save temporarily the original image in the tmp directory
     $path = APPD_TMP . DS . '{random}.{ext}';
     $source = $this->saveFileAs($path);
     if (!$source) {
         trigger_error("Could not create temporary thumbnail.", E_USER_WARNING);
         return false;
     }
     Loader::includeLibrary('phaxsithumb/PhaxsiThumb.php');
     $fk_thumb = new PhaxsiThumb($source);
     if ($fk_thumb->isError()) {
         @unlink($source);
         return false;
     }
     #Generate filenames if needed. $names will be returned.
     $names = array();
     for ($i = 0; $i < count($thumbs); $i++) {
         $info = pathinfo($this->_value['name']);
         $replacements = array('size' => isset($thumbs[$i][2]) ? $thumbs[$i][2] : '', 'width' => isset($thumbs[$i][2]) ? $thumbs[$i][2] : '', 'height' => isset($thumbs[$i][3]) ? $thumbs[$i][3] : '', 'name' => $info['filename'], 'ext' => $info['extension']);
         $thumbs[$i][1] = PathHelper::replaceUploadsDir($thumbs[$i][1]);
         $thumbs[$i][1] = PathHelper::parse($thumbs[$i][1], $replacements);
         $dir = dirname($thumbs[$i][1]);
         if (!file_exists($dir)) {
             $old = umask(0);
             mkdir($dir, 0777, true);
             umask($old);
         }
         $names[$i] = $thumbs[$i][1];
     }
     $success = call_user_func_array(array(&$fk_thumb, 'batchCreateThumbs'), $thumbs);
     @unlink($source);
     if (!$success) {
         return false;
     }
     return $names;
 }