From: Evan Prodromou Date: Wed, 28 May 2008 14:42:02 +0000 (-0400) Subject: don't scale avatar if original already matches size X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=84dfd8b52d4c3ce0e0435bf8cbc2a8504e01caa2;p=quix0rs-gnu-social.git don't scale avatar if original already matches size darcs-hash:20080528144202-84dde-d0f15e4ad4c840816bfadf3b1b57faecdfd401b2.gz --- diff --git a/actions/avatar.php b/actions/avatar.php index 7eed48ddb2..9c736cd3b6 100644 --- a/actions/avatar.php +++ b/actions/avatar.php @@ -126,7 +126,10 @@ class AvatarAction extends SettingsAction { $avatar->created = DB_DataObject_Cast::dateTime(); # current time foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) { - $scaled[] = $this->scale_avatar($user, $avatar, $size); + # We don't need a scaled one if the original is already of that size! + if ($avatar->width != $size && $avatar->height != $size) { + $scaled[] = $this->scale_avatar($user, $avatar, $size); + } } # XXX: start a transaction here