Thursday, 8 June 2017

gm(GraphicsMagick): Random failure while watermarking image

I am trying to watermark images using gm library. When done for single image, the image gets watermarked always, but when done for several images (even serially), for ex: 10, sometimes 1 or 2 images don't get watermarked and gm still returns success with the new image url. The above behavior of not watermarking images is very random and is not specific to a set of images.

gm(image_url)
  .draw([`image Over 0,0 0,0 logo.png`])
  .toBuffer(function (err, buffer) {
    // Upload buffer onto media server using 'request' library
});

I am unable to debug the random behavior of gm. Has anyone faced similar issue or can help me in figuring this out?



via Aman

No comments:

Post a Comment