From 3461e1678413adbe19ada305840fa9d6b339434b Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sun, 24 Jul 2016 23:04:36 +0200 Subject: [PATCH] Overhauled user profile header and avatar sizes --- .../lib/system/worker/UserRebuildDataWorker.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index e5574efa64..bd628ccad2 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -95,10 +95,17 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker { } if ($width < UserAvatar::AVATAR_SIZE || $height < UserAvatar::AVATAR_SIZE) { + $adapter = ImageHandler::getInstance()->getAdapter(); + $adapter->loadFile($avatar->getLocation()); + $adapter->resize(0, 0, $width, $height, UserAvatar::AVATAR_SIZE, UserAvatar::AVATAR_SIZE); + $adapter->writeImage($adapter->getImage(), $avatar->getLocation()); + $width = $height = UserAvatar::AVATAR_SIZE; } $editor = new UserAvatarEditor($avatar); $editor->update([ + 'width' => $width, + 'height' => $height ]); } } -- 2.20.1