[COMPONENTS][Avatar] Make sure dimension values are integers
[CARDS][Note] Fix assumed avatar dimension values
This commit is contained in:
parent
65a3d738ca
commit
19975b8d8d
@ -116,9 +116,8 @@ class Avatar extends Component
|
|||||||
public static function getDimensions(int $actor_id, string $size = 'medium')
|
public static function getDimensions(int $actor_id, string $size = 'medium')
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$avatar = self::getAvatar($actor_id);
|
$attachment = self::getAvatar($actor_id)->getAttachment();
|
||||||
$a = $size === 'full' ? $avatar->getAttachment() : $avatar->getAttachmentThumbnail($size);
|
return ['width' => (int) $attachment->getWidth(), 'height' => (int) $attachment->getHeight()];
|
||||||
return ['width' => $a->getWidth(), 'height' => $a->getHeight()];
|
|
||||||
} catch (NoAvatarException) {
|
} catch (NoAvatarException) {
|
||||||
return ['width' => Common::config('thumbnail', 'small'), 'height' => Common::config('thumbnail', 'small')];
|
return ['width' => Common::config('thumbnail', 'small'), 'height' => Common::config('thumbnail', 'small')];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user