]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts: Don't resize profile picture if it's not too big.
authorThomas Tanghus <thomas@tanghus.net>
Thu, 3 May 2012 09:04:51 +0000 (11:04 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Thu, 3 May 2012 09:15:44 +0000 (11:15 +0200)
apps/contacts/ajax/savecrop.php

index 36d582eca9c352dc6486e320fff71e59533ab307..958f9fd926c913429b7cf161c10b4973c962ebce 100755 (executable)
@@ -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);