mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30:15 +01:00
🖼️ feat: Avatar GIF Support & Dynamic Extensions (#7657)
This commit is contained in:
parent
aca89091d9
commit
442b149d55
7 changed files with 58 additions and 10 deletions
|
|
@ -129,7 +129,10 @@ async function processLocalAvatar({ buffer, userId, manual }) {
|
|||
userId,
|
||||
);
|
||||
|
||||
const fileName = `avatar-${new Date().getTime()}.png`;
|
||||
const metadata = await sharp(buffer).metadata();
|
||||
const extension = metadata.format === 'gif' ? 'gif' : 'png';
|
||||
|
||||
const fileName = `avatar-${new Date().getTime()}.${extension}`;
|
||||
const urlRoute = `/images/${userId}/${fileName}`;
|
||||
const avatarPath = path.join(userDir, fileName);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue