mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-01 22:01:49 +01:00
Do not transcode images if they meet the size thresholds
This commit is contained in:
@@ -73,7 +73,19 @@ export async function autoScale({
|
||||
return { contentType, file, fileName };
|
||||
}
|
||||
|
||||
const blob = await scaleImageToLevel(file, true);
|
||||
const { blob, contentType: newContentType } = await scaleImageToLevel(
|
||||
file,
|
||||
contentType,
|
||||
true
|
||||
);
|
||||
|
||||
if (newContentType !== IMAGE_JPEG) {
|
||||
return {
|
||||
contentType,
|
||||
file: blob,
|
||||
fileName,
|
||||
};
|
||||
}
|
||||
|
||||
const { name } = path.parse(fileName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user