Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix(avatar): crop non-square images instead of stretching them (#23064)

YuTengjingb1831fc6958d
diff --git a/src/components/Avatar/index.tsx b/src/components/Avatar/index.tsx
index f3075ffee61..4123da5d8a7 100644
--- a/src/components/Avatar/index.tsx
+++ b/src/components/Avatar/index.tsx
@@ -49,6 +49,9 @@ const Avatar = memo<AvatarProps>(
height={size}
loading={'lazy'}
src={src}
+ // Mirrors @lobehub/ui's own avatar <img>: crop a non-square image
+ // to the square instead of stretching it.
+ style={{ objectFit: 'cover' }}
width={size}
onError={markBroken}
/>