aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Photos.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-11-17 08:41:26 +0000
committerMario <mario@mariovavti.com>2018-11-17 09:51:28 +0100
commit783cca1e13ae480b31ddcffce6f014fbd1cdc34a (patch)
treec94bc223baf617071fcfbc6d479c7b605e484fb9 /Zotlabs/Module/Photos.php
parent238a616292ad5c6e7be97a4dd763a302729abf80 (diff)
downloadvolse-hubzilla-783cca1e13ae480b31ddcffce6f014fbd1cdc34a.tar.gz
volse-hubzilla-783cca1e13ae480b31ddcffce6f014fbd1cdc34a.tar.bz2
volse-hubzilla-783cca1e13ae480b31ddcffce6f014fbd1cdc34a.zip
recalculate photo filesize when rotating an image
(cherry picked from commit f15e32d0637fdf84de7cab43b558ec8a383d3cf5)
Diffstat (limited to 'Zotlabs/Module/Photos.php')
-rw-r--r--Zotlabs/Module/Photos.php29
1 files changed, 19 insertions, 10 deletions
diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php
index 03fd8a53d..21f6293ef 100644
--- a/Zotlabs/Module/Photos.php
+++ b/Zotlabs/Module/Photos.php
@@ -264,7 +264,7 @@ class Photos extends \Zotlabs\Web\Controller {
}
$x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 0",
- dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
dbescbin($data),
intval($fsize),
intval($height),
@@ -278,10 +278,13 @@ class Photos extends \Zotlabs\Web\Controller {
$width = $ph->getWidth();
$height = $ph->getHeight();
+ $data = $ph->imageString();
+ $fsize = strlen($data);
- $x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 1",
- dbesc(datetime_convert()),
- dbescbin($ph->imageString()),
+ $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 1",
+ dbesc(datetime_convert()),
+ dbescbin($data),
+ intval($fsize),
intval($height),
intval($width),
dbesc($resource_id),
@@ -294,10 +297,13 @@ class Photos extends \Zotlabs\Web\Controller {
$width = $ph->getWidth();
$height = $ph->getHeight();
+ $data = $ph->imageString();
+ $fsize = strlen($data);
- $x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 2",
- dbesc(datetime_convert()),
- dbescbin($ph->imageString()),
+ $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 2",
+ dbesc(datetime_convert()),
+ dbescbin($data),
+ intval($fsize),
intval($height),
intval($width),
dbesc($resource_id),
@@ -310,10 +316,13 @@ class Photos extends \Zotlabs\Web\Controller {
$width = $ph->getWidth();
$height = $ph->getHeight();
+ $data = $ph->imageString();
+ $fsize = strlen($data);
- $x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 3",
- dbesc(datetime_convert()),
- dbescbin($ph->imageString()),
+ $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 3",
+ dbesc(datetime_convert()),
+ dbescbin($data),
+ intval($fsize),
intval($height),
intval($width),
dbesc($resource_id),