Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public function execute()

$width = $avatar->width;
$height = $avatar->height;
if ($width != $height) {
if ($width !== $height && $width >= UserAvatarFileProcessor::AVATAR_SIZE && $height >= UserAvatarFileProcessor::AVATAR_SIZE) {
// make avatar quadratic
// minimum size is 128x128, maximum size is 256x256
$width = $height = \min(
Expand All @@ -293,10 +293,13 @@ public function execute()
$thumbnail = null;
}

if (
$width != UserAvatarFileProcessor::AVATAR_SIZE
&& $width != UserAvatarFileProcessor::AVATAR_SIZE_2X
) {
if ((
$width !== UserAvatarFileProcessor::AVATAR_SIZE
&& $width !== UserAvatarFileProcessor::AVATAR_SIZE_2X
) || (
$height !== UserAvatarFileProcessor::AVATAR_SIZE
&& $height !== UserAvatarFileProcessor::AVATAR_SIZE_2X
)) {
// resize avatar
$adapter = ImageHandler::getInstance()->getAdapter();

Expand Down