π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Preserve fallback behavior for temporary image extensions
Neeraj Gupta558f829da666
diff --git a/desktop/src/main/utils/temp.ts b/desktop/src/main/utils/temp.tsindex a35847b5cc..f98c0a22ad 100644--- a/desktop/src/main/utils/temp.ts+++ b/desktop/src/main/utils/temp.ts@@ -67,11 +67,13 @@ export const makeFileForStreamOrPathOrZipItem = async (filePath = item;isFileTemporary = false;} else {- const extension =- Array.isArray(item) &&- (!detectedExtension || detectedExtension === "tif")- ? path.extname(item[1]).slice(1) || detectedExtension- : detectedExtension;+ const fileNameExtension =+ Array.isArray(item) && detectedExtension === "tif"+ ? path.extname(item[1]).slice(1)+ : "";+ const extension = /^[a-z0-9]+$/i.test(fileNameExtension)+ ? fileNameExtension+ : detectedExtension;filePath = await makeTempFilePath(extension);isFileTemporary = true;if (item instanceof ReadableStream) {diff --git a/web/packages/gallery/services/convert-core.ts b/web/packages/gallery/services/convert-core.tsindex 57a3334786..971f7ad0f9 100644--- a/web/packages/gallery/services/convert-core.ts+++ b/web/packages/gallery/services/convert-core.ts@@ -27,9 +27,12 @@ export const renderableImageBlobWeb = async (if (opts?.convertToJPEG) {try {+ const fileNameExtension =+ lowercaseExtension(fileName) ?? "";const inputExtension =- extension === "tif"- ? lowercaseExtension(fileName) || extension+ extension === "tif" &&+ /^[a-z0-9]+$/.test(fileNameExtension)+ ? fileNameExtension: extension;return await opts.convertToJPEG(imageBlob, inputExtension);} catch (e) {