From 78a649cae3871f2fc9a12b846f5f59b8c3858d78 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 14 May 2024 19:47:07 +0530 Subject: [PATCH] [desktop] Ignore imagemagick on ARM in one more place --- desktop/src/main/services/image.ts | 4 ++++ web/apps/photos/src/services/upload/uploadService.ts | 2 ++ web/apps/photos/src/utils/file/index.ts | 2 ++ 3 files changed, 8 insertions(+) diff --git a/desktop/src/main/services/image.ts b/desktop/src/main/services/image.ts index 8f72caedd..c07b051a1 100644 --- a/desktop/src/main/services/image.ts +++ b/desktop/src/main/services/image.ts @@ -45,6 +45,9 @@ const convertToJPEGCommand = ( ]; case "linux": + // The bundled binary is an ELF x86-64 executable. + if (process.arch != "x64") + throw new Error(CustomErrorMessage.NotAvailable); return [ imageMagickPath(), inputFilePath, @@ -90,6 +93,7 @@ export const generateImageThumbnail = async ( let thumbnail: Uint8Array; do { await execAsync(command); + // TODO(MR): release 1.7 // TODO(MR): imagemagick debugging. Remove me after verifying logs. log.info(`Generated thumbnail using ${command.join(" ")}`); thumbnail = new Uint8Array(await fs.readFile(outputFilePath)); diff --git a/web/apps/photos/src/services/upload/uploadService.ts b/web/apps/photos/src/services/upload/uploadService.ts index 52f495785..403fdbb88 100644 --- a/web/apps/photos/src/services/upload/uploadService.ts +++ b/web/apps/photos/src/services/upload/uploadService.ts @@ -1023,6 +1023,8 @@ const withThumbnail = async ( } catch (e) { if (e.message.endsWith(CustomErrorMessage.NotAvailable)) { moduleState.isNativeImageThumbnailGenerationNotAvailable = true; + // TODO(MR): release 1.7 + log.info("Setting isNativeImageThumbnailGenerationNotAvailable", e); } else { log.error("Native thumbnail generation failed", e); } diff --git a/web/apps/photos/src/utils/file/index.ts b/web/apps/photos/src/utils/file/index.ts index af5c06e8e..4f9ec1845 100644 --- a/web/apps/photos/src/utils/file/index.ts +++ b/web/apps/photos/src/utils/file/index.ts @@ -309,6 +309,8 @@ export const getRenderableImage = async (fileName: string, imageBlob: Blob) => { } catch (e) { if (e.message.endsWith(CustomErrorMessage.NotAvailable)) { moduleState.isNativeJPEGConversionNotAvailable = true; + // TODO(MR): release 1.7 + log.info("Setting isNativeJPEGConversionNotAvailable", e); } else { log.error("Native conversion to JPEG failed", e); }