From 93f79ece589101149e5fd133b534d8705c159ffc Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 27 Sep 2016 11:25:05 +0200 Subject: [PATCH] Fixed avatar import --- .../importer/UserAvatarImporter.class.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php index 30d9f6746d..f2165c7996 100644 --- a/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php @@ -1,9 +1,9 @@ executeAction(); + // enforces dimensions + if ($data['width'] > UserAvatar::AVATAR_SIZE || $data['height'] > UserAvatar::AVATAR_SIZE) { + try { + $adapter = ImageHandler::getInstance()->getAdapter(); + $adapter->loadFile($avatar->getLocation()); + $thumbnail = $adapter->createThumbnail(UserAvatar::AVATAR_SIZE, UserAvatar::AVATAR_SIZE, false); + $adapter->writeImage($thumbnail, $avatar->getLocation()); + } + catch (SystemException $e) { + throw new SystemException(); + } + } // update owner $sql = "UPDATE wcf".WCF_N."_user -- 2.20.1