firebase / functions-samples

Collection of sample apps showcasing popular use cases using Cloud Functions for Firebase
https://firebase.google.com/docs/functions
Apache License 2.0
12.03k stars 3.83k forks source link

Firebase Cloud function imagemagick composite command to overlay images #429

Open abhishekjinxed opened 6 years ago

abhishekjinxed commented 6 years ago

i am trying to over image on another image using imagemagick on cloud function and looked into the imagemagick command like this:

convert a.png b.png -gravity center -composite result.png

i know it doesnt work like that in firebase cloud function so i looked for example and have something like this:

return spawn('convert', [tmpFilePath, tmpFilePath2, '-gravity', 'center', '-composite', tmpFilePath3]);

i get an error like this :

ChildProcessError: convert /tmp/default.jpg /tmp/IMG_4947.JPG
  -gravity center -composite /tmp/newimage.jpg failed with code 1
timurridjanovic commented 4 years ago

@abhishekjinxed Did you ever figure out what that issue was? I'm getting the same thing..