From 8547e4b2a8f41b6a600006b2673809e5b383059b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 25 Mar 2014 12:44:30 -0700 Subject: ensure wall_upload always has width and height if the image is valid --- include/photos.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/photos.php b/include/photos.php index c0243cc15..d1462a27f 100644 --- a/include/photos.php +++ b/include/photos.php @@ -174,10 +174,10 @@ function photo_upload($channel, $observer, $args) { $p['scale'] = 2; $r3 = $ph->save($p); $smallest = 2; - $width_x_height = $ph->getWidth() . 'x' . $ph->getHeight(); if(! $r3) $errors = true; } + if($errors) { q("delete from photo where resource_id = '%s' and uid = %d", @@ -190,6 +190,10 @@ function photo_upload($channel, $observer, $args) { return $ret; } + // This will be the width and height of the smallest representation + + $width_x_height = $ph->getWidth() . 'x' . $ph->getHeight(); + $basename = basename($filename); $mid = item_message_id(); -- cgit v1.2.3