Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jhashrikant opened this issue Apr 12, 2023 · 0 comments
Open

Comments

@jhashrikant
Copy link

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 protected]")
.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant