🖼️ feat: Avatar GIF Support & Dynamic Extensions (#7657)

This commit is contained in:
Marco Beretta 2025-06-02 13:51:38 +02:00 committed by GitHub
parent aca89091d9
commit 442b149d55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 58 additions and 10 deletions

View file

@ -97,10 +97,14 @@ async function prepareAzureImageURL(req, file) {
*/
async function processAzureAvatar({ buffer, userId, manual, basePath = 'images', containerName }) {
try {
const metadata = await sharp(buffer).metadata();
const extension = metadata.format === 'gif' ? 'gif' : 'png';
const fileName = `avatar.${extension}`;
const downloadURL = await saveBufferToAzure({
userId,
buffer,
fileName: 'avatar.png',
fileName,
basePath,
containerName,
});