aheckmann / gm

GraphicsMagick for node
http://aheckmann.github.com/gm/
6.95k stars 615 forks source link

Error: Command failed: gm composite: Unrecognized option (-fill). #857

Open jhashrikant opened 1 year ago

jhashrikant commented 1 year ago

Im trying to add a image on the main image using composite but its giving error like above. gm('input.jpg').size(function (err, size) { if (!err) { //top yellow border gm('input.jpg') .fill("orange") .drawRectangle(0, 15, size.width, 150) //bottom yellow border .fill("orange") .drawRectangle(0, size.height - 25, size.width, size.height) //school name .font("unicode.utopia.ttf", 36) .fill('black') .drawText(150, 100, "Some text") //credentials .font("unicode.utopia.ttf", 16) .drawText(900, 50, "Tel: +telephone") .drawText(900, 70, "Fax: add your number") .drawText(900, 90, "Email: email@email.com") .drawText(900, 110, "website: www.url.com") //address .font("unicode.utopia.ttf", 24) .fill('black') .drawText(50, 200, Name : ${student_name}) .drawText(50, 250, Father: ${father_name}) .drawText(50, 300, Class: ${Class}) .drawText(50, 350, Section: ${Section}) .drawText(50, 400, Phone: ${phone}) .drawText(50, 450, Address: ${address}) //studentID .font("unicode.utopia.ttf", 20) .drawText(size.width - 200, 200, "StudentId") .drawText(size.width - 200, 225, "110562") //studentImg

  .composite('studentImg.jpg')
  .geometry('+100+150')

  .write("output.png", function (err) {
    if (!err) {
      console.log('success');
    }
    else {
      console.log(err);
    }
  });

} })

rest all code are working fine if i attach the composite one then its not overlaying on the main image and if i just comment out the rest of code other than teh composite it works