示例#1
0
文件: image.php 项目: ZyXelP/oxwall
 /**
  * Copies image
  *
  * @param string $destPath
  * 
  * @return UTIL_Image
  */
 public function saveImage($destPath = null)
 {
     if (!isset($destPath)) {
         $this->image->saveToFile($this->sourcePath, self::IMAGE_QUALITY);
     } else {
         $this->image->saveToFile($destPath, self::IMAGE_QUALITY);
     }
     return $this;
 }
示例#2
0
 /**
  * @param WideImage_Image $img
  * @param string          $key
  * @param string          $ext
  *
  * @return string
  */
 private function saveImage($img, $key, $ext)
 {
     $path = apply_filters('bfwi_change_save_path_filter', $this->wide_image_dir . $key, $key);
     if ($ext === 'jpg' || $ext === 'jpeg') {
         $img->saveToFile($path, 90);
     } else {
         $img->saveToFile($path);
     }
     do_action('bfwi_img_saved_action', $key, $path);
     wp_cache_set('image_exists:' . $key, true, self::CACHE_GROUP);
     return apply_filters('bfwi_image_url_filter', $this->wide_image_url . $key, $key);
 }