diff --git a/server/app/Services/Upload/UserAvatarManager.php b/server/app/Services/Upload/UserAvatarManager.php index d92b47d..92ec3a0 100644 --- a/server/app/Services/Upload/UserAvatarManager.php +++ b/server/app/Services/Upload/UserAvatarManager.php @@ -11,9 +11,8 @@ use Intervention\Image\ImageManager; class UserAvatarManager { - const AVATAR_WIDTH = 160; - - const AVATAR_HEIGHT = 160; + const AVATAR_WIDTH = 500; + const AVATAR_HEIGHT = 500; /** * @var User @@ -119,9 +118,11 @@ class UserAvatarManager $image->crop($size, $size, (int) $points['x1'], (int) $points['y1']) ->resize(self::AVATAR_WIDTH, self::AVATAR_HEIGHT); } else { - // If crop points are not provided, we will just crop - // provided image to specified width and height. - $image->crop(self::AVATAR_WIDTH, self::AVATAR_HEIGHT); + // If crop points are not provided, we will just resize maintaining aspect ratio. + $image->resize(self::AVATAR_WIDTH, self::AVATAR_HEIGHT, function ($constraint) { + $constraint->aspectRatio(); + $constraint->upsize(); + }); } $fileName = $file->hashName($this->getDestinationDirectory());