diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-11-17 09:41:26 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-11-17 09:41:26 +0100 |
commit | f15e32d0637fdf84de7cab43b558ec8a383d3cf5 (patch) | |
tree | db22f2cb3a841ba6c2ffff83bea35a34beb28517 /Zotlabs/Module | |
parent | afc75af62f759181bbe6a806b523c6ca52126f5f (diff) | |
download | volse-hubzilla-f15e32d0637fdf84de7cab43b558ec8a383d3cf5.tar.gz volse-hubzilla-f15e32d0637fdf84de7cab43b558ec8a383d3cf5.tar.bz2 volse-hubzilla-f15e32d0637fdf84de7cab43b558ec8a383d3cf5.zip |
recalculate photo filesize when rotating an image
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Photos.php | 29 |
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), |