From 6cc9f600d21cc54b4df76c2ffda7a45126f20d23 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 3 May 2012 11:04:51 +0200 Subject: [PATCH] Contacts: Don't resize profile picture if it's not too big. --- apps/contacts/ajax/savecrop.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/contacts/ajax/savecrop.php b/apps/contacts/ajax/savecrop.php index 36d582eca9c..958f9fd926c 100755 --- a/apps/contacts/ajax/savecrop.php +++ b/apps/contacts/ajax/savecrop.php @@ -70,7 +70,7 @@ if(file_exists($tmp_path)) { $h = ($h != -1 ? $h : $image->height()); OCP\Util::writeLog('contacts','savecrop.php, x: '.$x1.' y: '.$y1.' w: '.$w.' h: '.$h, OCP\Util::DEBUG); if($image->crop($x1, $y1, $w, $h)) { - if($image->resize(200)) { + if(($image->width() <= 200 && $image->height() <= 200) || $image->resize(200)) { $tmpfname = tempnam("/tmp", "occCropped"); // create a new file because of caching issues. if($image->save($tmpfname)) { unlink($tmp_path); -- 2.39.5