Merge branch 'dev' into 'dev'
Change thumbnails processing logic on image edit See merge request hubzilla/core!1637
This commit is contained in:
commit
7b17306dbd
@ -273,7 +273,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$ph->save($arr);
|
$ph->save($arr);
|
||||||
|
|
||||||
unset($arr['photo_usage']);
|
unset($arr['os_syspath']);
|
||||||
|
|
||||||
if($width > 1024 || $height > 1024)
|
if($width > 1024 || $height > 1024)
|
||||||
$ph->scaleImage(1024);
|
$ph->scaleImage(1024);
|
||||||
|
@ -508,18 +508,6 @@ abstract class PhotoDriver {
|
|||||||
|
|
||||||
$arr['imgscale'] = $scale;
|
$arr['imgscale'] = $scale;
|
||||||
|
|
||||||
if(! array_key_exists('photo_usage', $arr)) {
|
|
||||||
$x = q("SELECT photo_usage FROM photo WHERE resource_id = '%s' AND uid = %d AND imgscale = %d LIMIT 1",
|
|
||||||
dbesc($arr['resource_id']),
|
|
||||||
intval($arr['uid']),
|
|
||||||
intval($arr['imgscale'])
|
|
||||||
);
|
|
||||||
if($x)
|
|
||||||
$arr['photo_usage'] = $r[0]['photo_usage'];
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(boolval(get_config('system','filesystem_storage_thumbnails', 0)) && $scale > 0) {
|
if(boolval(get_config('system','filesystem_storage_thumbnails', 0)) && $scale > 0) {
|
||||||
$channel = \App::get_channel();
|
$channel = \App::get_channel();
|
||||||
$arr['os_storage'] = 1;
|
$arr['os_storage'] = 1;
|
||||||
@ -527,6 +515,8 @@ abstract class PhotoDriver {
|
|||||||
if(! $this->saveImage($arr['os_syspath']))
|
if(! $this->saveImage($arr['os_syspath']))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
$arr['os_storage'] = 0;
|
||||||
|
|
||||||
if(! $this->save($arr)) {
|
if(! $this->save($arr)) {
|
||||||
if(array_key_exists('os_syspath', $arr))
|
if(array_key_exists('os_syspath', $arr))
|
||||||
|
Reference in New Issue
Block a user