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

remotes/origin/stable4
Thomas Tanghus 14 years ago
parent 351740601a
commit 6cc9f600d2
  1. 2
      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);

Loading…
Cancel
Save