summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/avatar.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/actions/avatar.php b/actions/avatar.php
index 7eed48ddb..9c736cd3b 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