]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't scale avatar if original already matches size
authorEvan Prodromou <evan@prodromou.name>
Wed, 28 May 2008 14:42:02 +0000 (10:42 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 28 May 2008 14:42:02 +0000 (10:42 -0400)
darcs-hash:20080528144202-84dde-d0f15e4ad4c840816bfadf3b1b57faecdfd401b2.gz

actions/avatar.php

index 7eed48ddb227b3c079f1f55643b608c7333284da..9c736cd3b6fd65001372f013f45e7ab9479818c9 100644 (file)
@@ -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