Shashank3736 / captcha-canvas

A captcha generator by using skia-canvas.
https://captcha-canvas.js.org
Apache License 2.0
61 stars 12 forks source link

Image captcha not show words #36

Closed Le-Khuong closed 2 years ago

Le-Khuong commented 2 years ago

im confusing why the captcha image not showing words heres the image https://cdn.discordapp.com/attachments/888833092041715774/919229224085254164/Screen_Shot_2021-12-11_at_9.08.32_PM.png

Shashank3736 commented 2 years ago

We solved this in #31 Please check that issue first. If it doesn't work for you then show me the code also share the version of captcha-canvas you are using.

Le-Khuong commented 2 years ago

i think it is problem with my system font image and idk how to fixx it

Le-Khuong commented 2 years ago

and my code:

const { CaptchaGenerator } = require("captcha-canvas");
const {MessageAttachment} = require("discord.js")

const captcha = new CaptchaGenerator()
.setDimension(150, 450) 
.setCaptcha({color: '#1DAEEF'})
.setDecoy({opacity: 0.5})
.setTrace({color: '#1DAEEF'});

const captchaImageData = captcha.generateSync();
const captAttach = new MessageAttachment(captchaImageData , `captcha.png`)
message.channel.send(captAttach )
Shashank3736 commented 2 years ago

Your system must support skia-canvas try to install fontconfig in your system then try. Which OS you are using btw?

Le-Khuong commented 2 years ago

im using repl

Le-Khuong commented 2 years ago

also i have install skia-canvas and still not work

Shashank3736 commented 2 years ago

repl have some issues with skia-canvas in issue #31 the user have the same issues because he is using repl too.

Le-Khuong commented 2 years ago

oh ok thanks