From 19975b8d8d0a90a105c0941924bdf6384c058707 Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Sun, 26 Dec 2021 22:04:55 +0000 Subject: [PATCH] [COMPONENTS][Avatar] Make sure dimension values are integers [CARDS][Note] Fix assumed avatar dimension values --- components/Avatar/Avatar.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/Avatar/Avatar.php b/components/Avatar/Avatar.php index cc60aa59f6..203b6d31c0 100644 --- a/components/Avatar/Avatar.php +++ b/components/Avatar/Avatar.php @@ -116,9 +116,8 @@ class Avatar extends Component public static function getDimensions(int $actor_id, string $size = 'medium') { try { - $avatar = self::getAvatar($actor_id); - $a = $size === 'full' ? $avatar->getAttachment() : $avatar->getAttachmentThumbnail($size); - return ['width' => $a->getWidth(), 'height' => $a->getHeight()]; + $attachment = self::getAvatar($actor_id)->getAttachment(); + return ['width' => (int) $attachment->getWidth(), 'height' => (int) $attachment->getHeight()]; } catch (NoAvatarException) { return ['width' => Common::config('thumbnail', 'small'), 'height' => Common::config('thumbnail', 'small')]; }