aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-10-15 14:52:31 +0200
committerMario Vavti <mario@mariovavti.com>2015-10-15 14:52:31 +0200
commit9f5c61b1fd7a246ae5327d133842982b8b2385ce (patch)
tree58d34a8dbdf5470c694eb0beb106dabdad255436 /mod
parent3bca640521144e139f1f1c22b64decb2ba27c904 (diff)
downloadvolse-hubzilla-9f5c61b1fd7a246ae5327d133842982b8b2385ce.tar.gz
volse-hubzilla-9f5c61b1fd7a246ae5327d133842982b8b2385ce.tar.bz2
volse-hubzilla-9f5c61b1fd7a246ae5327d133842982b8b2385ce.zip
reflect default image size changes in mod/photos
Diffstat (limited to 'mod')
-rw-r--r--mod/photos.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/mod/photos.php b/mod/photos.php
index 65bc43b1b..6451304ff 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -252,12 +252,26 @@ function photos_post(&$a) {
intval($page_owner_uid)
);
+ if($width > 1024 || $height > 1024) {
+ $ph->scaleImage(1024);
+ $width = $ph->getWidth();
+ $height = $ph->getHeight();
+
+ $x = q("update photo set data = '%s', height = %d, width = %d where `resource_id` = '%s' and uid = %d and scale = 1",
+ dbescbin($ph->imageString()),
+ intval($height),
+ intval($width),
+ dbesc($resource_id),
+ intval($page_owner_uid)
+ );
+ }
+
if($width > 640 || $height > 640) {
$ph->scaleImage(640);
$width = $ph->getWidth();
$height = $ph->getHeight();
-
- $x = q("update photo set data = '%s', height = %d, width = %d where `resource_id` = '%s' and uid = %d and scale = 1",
+
+ $x = q("update photo set data = '%s', height = %d, width = %d where `resource_id` = '%s' and uid = %d and scale = 2",
dbescbin($ph->imageString()),
intval($height),
intval($width),
@@ -271,7 +285,7 @@ function photos_post(&$a) {
$width = $ph->getWidth();
$height = $ph->getHeight();
- $x = q("update photo set data = '%s', height = %d, width = %d where `resource_id` = '%s' and uid = %d and scale = 2",
+ $x = q("update photo set data = '%s', height = %d, width = %d where `resource_id` = '%s' and uid = %d and scale = 3",
dbescbin($ph->imageString()),
intval($height),
intval($width),