how to get cropped image names and paths after crop by imagemagick

44 Views Asked by At

I crop an image file by node module imagemagick. It crops successfully, but how to get the names (or paths) of cropped result images

My code:

const im = require('imagemagick');
....
const imgFile = "img.png";
im.convert([imgFile, '-crop', '300x300', 'test.png'],
  function(err, stdout){
    if (err) throw err;
    console.log('stdout:', stdout);
    // here: I want to get names (or paths) of cropped images
    }
)
0

There are 0 best solutions below