I am trying to resize image and reduce its DPI both at once using package.
I am using im.convert() instead of im.resize() because I have other options as well that needs to be specified. I tried to pass an array with all the options to the im.convert(), but I am getting an error that says "Error: Command failed: Invalid Parameter - -units"
const inputPath = "E:\PC\lister\uploads\dbmid_AAAeU6UkAOHoUmq6t25RPjK6g1sfK6gn7fg\Clients\Matt\2019-06-10T03-32-02.385Z45.jpg";'
const outputPath= "E:\PC\lister\uploads\dbmid_AAAeU6UkAOHoUmq6t25RPjK6g1sfK6gn7fg\Clients\Matt\Web\2019-06-10T03-32-02.385Z45.jpg";
const args = [
inputPath,
"-units",
"pixelsperinch",
"-density",
"75x75",
"-resize",
"1920",
outputPath
]
im.convert(args, function(err, stdout, stderr) {
if(err) console.log(err)
});
I am expecting the resized image with 75dpi in the folder called 'web' that I specified in the outputPath above. but I am getting an error that says "Error: Command failed: Invalid Parameter - -units"