Revert "Update htconfig.sample.php"

This reverts commit f2126ef18c8b66020305d07dcefeacc4e55a3c12
This commit is contained in:
Max Kostikov
2019-04-10 13:25:03 +02:00
committed by Mario
parent 47fd95db9d
commit 5d70d889e9
4 changed files with 48 additions and 7 deletions

View File

@@ -494,5 +494,32 @@ abstract class PhotoDriver {
return $r;
}
/**
* @brief Stores thumbnail to database or filesystem.
*
* @param array $arr
* @param scale int
* @return boolean|array
*/
public function storeThumbnail($arr, $scale = 0) {
if(boolval(get_config('system','filesystem_storage_thumbnails', 0)) && $scale > 0) {
$channel = \App::get_channel();
$arr['os_storage'] = 1;
$arr['imgscale'] = $scale;
$arr['os_syspath'] = 'store/' . $channel['channel_address'] . '/' . $arr['os_path'] . '-' . $scale;
if(! $this->saveImage($arr['os_syspath']))
return false;
}
if(! $this->save($arr)) {
if(array_key_exists('os_syspath', $arr))
@unlink($arr['os_syspath']);
return false;
}
return true;
}
}