resizeImage(image: string, destPath: string, [w, h]: ImageDimensions) {
return new Promise((resolve, reject) => {
gm(image)
.resize(w, h, "!")
.noProfile()
.write(destPath, (err) => {
if (err) return reject(err);
return resolve(destPath);
});
});
}
so i’m trying to resize the image and write it to destPath
.
the image
parameter is F:hobbygokz-imagesimagesbkz_measuremap.jpg
and destPath
is F:hobbygokz-imagespublicfullbkz_measuremap.jpg
in my case.
but i got this error said Command failed: gm convert: Unable to open file (F:hobbygokz-imagespublicfullbkz_measuremap.jpg).
i can make sure the source image and destination path both exist.
how can i fix this?