fix: wrong file length after exif strip (#36676)

This commit is contained in:
Matheus Cardoso 2025-08-11 13:16:10 -03:00 committed by GitHub
parent ab5bf99cd7
commit 61bca869b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---
Fixes an issue where files containing exif data would fail to upload to S3 when `Message_Attachments_Strip_Exif` is enabled.

View File

@ -211,6 +211,7 @@ API.v1.addRoute(
if (stripExif) {
// No need to check mime. Library will ignore any files without exif/xmp tags (like BMP, ico, PDF, etc)
fileBuffer = await Media.stripExifFromBuffer(fileBuffer);
details.size = fileBuffer.length;
}
const fileStore = FileUpload.getStore('Uploads');
@ -289,6 +290,7 @@ API.v1.addRoute(
if (stripExif) {
// No need to check mime. Library will ignore any files without exif/xmp tags (like BMP, ico, PDF, etc)
fileBuffer = await Media.stripExifFromBuffer(fileBuffer);
details.size = fileBuffer.length;
}
const fileStore = FileUpload.getStore('Uploads');