aboutsummaryrefslogtreecommitdiffstats
path: root/include/photos.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-10-15 14:18:40 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-10-15 14:18:40 -0700
commitbf5a1f662a4f00e8376613fa387c843d539c7433 (patch)
tree8077cf749de57edd83885859698c27dba9f6a31a /include/photos.php
parentd9753989bf63047051bc0fbfc6e2b438040acf85 (diff)
downloadvolse-hubzilla-bf5a1f662a4f00e8376613fa387c843d539c7433.tar.gz
volse-hubzilla-bf5a1f662a4f00e8376613fa387c843d539c7433.tar.bz2
volse-hubzilla-bf5a1f662a4f00e8376613fa387c843d539c7433.zip
generate all (non-square) photo scales - even if the original photo is smaller than the scale target sizes.
Diffstat (limited to 'include/photos.php')
-rw-r--r--include/photos.php42
1 files changed, 21 insertions, 21 deletions
diff --git a/include/photos.php b/include/photos.php
index 2fc25b4bf..618f36fb1 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -193,32 +193,32 @@ function photo_upload($channel, $observer, $args) {
unset($p['os_storage']);
unset($p['os_path']);
- if(($width > 1024 || $height > 1024) && (! $errors)) {
+ if(($width > 1024 || $height > 1024) && (! $errors))
$ph->scaleImage(1024);
- $p['scale'] = 1;
- $r2 = $ph->save($p);
- $smallest = 1;
- if(! $r2)
- $errors = true;
- }
- if(($width > 640 || $height > 640) && (! $errors)) {
+ $p['scale'] = 1;
+ $r2 = $ph->save($p);
+ $smallest = 1;
+ if(! $r2)
+ $errors = true;
+
+ if(($width > 640 || $height > 640) && (! $errors))
$ph->scaleImage(640);
- $p['scale'] = 2;
- $r3 = $ph->save($p);
- $smallest = 2;
- if(! $r3)
- $errors = true;
- }
- if(($width > 320 || $height > 320) && (! $errors)) {
+ $p['scale'] = 2;
+ $r3 = $ph->save($p);
+ $smallest = 2;
+ if(! $r3)
+ $errors = true;
+
+ if(($width > 320 || $height > 320) && (! $errors))
$ph->scaleImage(320);
- $p['scale'] = 3;
- $r3 = $ph->save($p);
- $smallest = 3;
- if(! $r3)
- $errors = true;
- }
+
+ $p['scale'] = 3;
+ $r3 = $ph->save($p);
+ $smallest = 3;
+ if(! $r3)
+ $errors = true;
if($errors) {
q("delete from photo where resource_id = '%s' and uid = %d",