luthraG / image-watermark

A powerful watermark library for single page images, multipage images, and pdf files based on ImageMagick for node.js
https://www.npmjs.com/package/image-watermark
MIT License
102 stars 33 forks source link

Invalid parameter size #14

Open nippur72 opened 6 years ago

nippur72 commented 6 years ago

I get the following error...

Image-Watermark::embedWatermark : Error in applying watermark : Error: Command failed: Invalid parameter - -size

from the following the code:

const watermark = require('image-watermark');
const options = {
    'text' : 'sample watermark', 
    'dstPath' : 'out.pdf'
};
watermark.embedWatermark('test.pdf', options);

OS is W10 and node is v7.7.1. The test image is a pdf file containing a scanned monochrome A4 page.

DJayFreshBlock commented 3 years ago

I was running into this same issue. Seems that windows cmd "convert" is being called in place of the ImageMagick convert.exe.

I updated the node_modules\imagemagick\imagemagick.js:256 to be: exports.convert.path = 'C:\\Program Files\\ImageMagick-7.1.0-Q16-HDRI\\convert';

Update your path with the proper system path for your ImageMagick install.