[desktop] Fix the imagemagick path when running in dev build (#1477)

"resources" needs to be "build"
This commit is contained in:
Manav Rathi 2024-04-18 14:24:02 +05:30 committed by GitHub
commit 89162bc45f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,11 +67,8 @@ const IMAGE_MAGICK_THUMBNAIL_GENERATE_COMMAND_TEMPLATE = [
OUTPUT_PATH_PLACEHOLDER,
];
function getImageMagickStaticPath() {
return isDev
? "resources/image-magick"
: path.join(process.resourcesPath, "image-magick");
}
const imageMagickStaticPath = () =>
path.join(isDev ? "build" : process.resourcesPath, "image-magick");
export async function convertToJPEG(
fileData: Uint8Array,
@ -140,7 +137,7 @@ function constructConvertCommand(
convertCmd = IMAGEMAGICK_HEIC_CONVERT_COMMAND_TEMPLATE.map(
(cmdPart) => {
if (cmdPart === IMAGE_MAGICK_PLACEHOLDER) {
return getImageMagickStaticPath();
return imageMagickStaticPath();
}
if (cmdPart === INPUT_PATH_PLACEHOLDER) {
return tempInputFilePath;
@ -262,7 +259,7 @@ function constructThumbnailGenerationCommand(
thumbnailGenerationCmd =
IMAGE_MAGICK_THUMBNAIL_GENERATE_COMMAND_TEMPLATE.map((cmdPart) => {
if (cmdPart === IMAGE_MAGICK_PLACEHOLDER) {
return getImageMagickStaticPath();
return imageMagickStaticPath();
}
if (cmdPart === INPUT_PATH_PLACEHOLDER) {
return inputFilePath;