1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Contacts: Don't resize profile picture if it's not too big.

This commit is contained in:
Thomas Tanghus 2012-05-03 11:04:51 +02:00
parent 0b43e94733
commit 07820c10ba

View File

@ -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);