[desktop] Ignore imagemagick on ARM in one more place

This commit is contained in:
Manav Rathi 2024-05-14 19:47:07 +05:30
parent 3adadee82b
commit 78a649cae3
No known key found for this signature in database
3 changed files with 8 additions and 0 deletions

View file

@ -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));

View file

@ -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);
}

View file

@ -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);
}