aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Photo
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-04-10 13:25:03 +0200
committerMario <mario@mariovavti.com>2019-04-10 13:25:03 +0200
commit5d70d889e908a32c846b9da3eb26703064d20ec6 (patch)
tree2bf3365bec1b814fa0d2f4d407dd75c96bc0762a /Zotlabs/Photo
parent47fd95db9d2edc21f113e5843d87af9d9b62b243 (diff)
downloadvolse-hubzilla-5d70d889e908a32c846b9da3eb26703064d20ec6.tar.gz
volse-hubzilla-5d70d889e908a32c846b9da3eb26703064d20ec6.tar.bz2
volse-hubzilla-5d70d889e908a32c846b9da3eb26703064d20ec6.zip
Revert "Update htconfig.sample.php"
This reverts commit f2126ef18c8b66020305d07dcefeacc4e55a3c12
Diffstat (limited to 'Zotlabs/Photo')
-rw-r--r--Zotlabs/Photo/PhotoDriver.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/Zotlabs/Photo/PhotoDriver.php b/Zotlabs/Photo/PhotoDriver.php
index c47a7c3b2..4c7da92cf 100644
--- a/Zotlabs/Photo/PhotoDriver.php
+++ b/Zotlabs/Photo/PhotoDriver.php
@@ -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;
+ }
}