Commit 84dfd8b5 authored by Evan Prodromou's avatar Evan Prodromou

don't scale avatar if original already matches size

darcs-hash:20080528144202-84dde-d0f15e4ad4c840816bfadf3b1b57faecdfd401b2.gz
parent e0cce107
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment