}
public static function getThumbnail($image_name) {
- $imagePath = OC_Filesystem::getLocalFile($image_name);
- if(!file_exists($imagePath)) {
- return null;
- }
$save_dir = OC_Config::getValue("datadirectory").'/'. OC_User::getUser() .'/gallery/';
$save_dir .= dirname($image_name). '/';
$image_name = basename($image_name);
if (file_exists($thumb_file)) {
$image = new OC_Image($thumb_file);
} else {
+ $imagePath = OC_Filesystem::getLocalFile($image_name);
+ if(!file_exists($imagePath)) {
+ return null;
+ }
$image = new OC_Image($imagePath);
if ($image->valid()) {
$image->centerCrop();
}
}
if ($image->valid()) {
- //var_dump($image, $image->resource());
return $image;
}
return null;