aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-05-08 08:32:57 +0200
committerMax Kostikov <max@kostikov.co>2019-05-08 08:32:57 +0200
commit7b17306dbd6f7d41d47aa13be208b7283409db7a (patch)
tree69117d23ff72129333a68d7e597f736c008cdb7f
parent6fc242954072b6dcae2af47d45e15861772b5fea (diff)
parent6731564c2d71475435fd83fa8c63dd8d45f1ad34 (diff)
downloadvolse-hubzilla-7b17306dbd6f7d41d47aa13be208b7283409db7a.tar.gz
volse-hubzilla-7b17306dbd6f7d41d47aa13be208b7283409db7a.tar.bz2
volse-hubzilla-7b17306dbd6f7d41d47aa13be208b7283409db7a.zip
Merge branch 'dev' into 'dev'
Change thumbnails processing logic on image edit See merge request hubzilla/core!1637
-rw-r--r--Zotlabs/Module/Photos.php2
-rw-r--r--Zotlabs/Photo/PhotoDriver.php16
2 files changed, 4 insertions, 14 deletions
diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php
index 29265050b..13ec64ab9 100644
--- a/Zotlabs/Module/Photos.php
+++ b/Zotlabs/Module/Photos.php
@@ -273,7 +273,7 @@ class Photos extends \Zotlabs\Web\Controller {
$ph->save($arr);
- unset($arr['photo_usage']);
+ unset($arr['os_syspath']);
if($width > 1024 || $height > 1024)
$ph->scaleImage(1024);
diff --git a/Zotlabs/Photo/PhotoDriver.php b/Zotlabs/Photo/PhotoDriver.php
index a1fba5615..bacf926ff 100644
--- a/Zotlabs/Photo/PhotoDriver.php
+++ b/Zotlabs/Photo/PhotoDriver.php
@@ -507,19 +507,7 @@ abstract class PhotoDriver {
public function storeThumbnail($arr, $scale = 0) {
$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) {
$channel = \App::get_channel();
$arr['os_storage'] = 1;
@@ -527,6 +515,8 @@ abstract class PhotoDriver {
if(! $this->saveImage($arr['os_syspath']))
return false;
}
+ else
+ $arr['os_storage'] = 0;
if(! $this->save($arr)) {
if(array_key_exists('os_syspath', $arr))