Shashank3736 / captcha-canvas

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

invalid ELF header #53

Closed WoWisme closed 1 year ago

WoWisme commented 1 year ago

Hello. I am having a problem using the skia-canvas, and I tried to do the captcha setup on my local host pc, which worked fine, but after trying to set my bot up on a oracle linux server, it gave me new errors. I have no clue why, but it gave me the error: https://sourceb.in/OyEm3YVZkb

I fixed this by reinstalling node_modules, and doing npm install skia-canvas (I also did some other funky commands to fix a error, something to do with libfontconfig). When that was fixed, it worked. I could get my captcha, but all the text had now been made smaller. The letters and numbers before on my local host was normal. A good size that was easy to read, but on the host, it was micro, and hard to see what they were.

Before: image

After: image

I am not so used to GitHub, so I may not see any given message. So if you are able to help with the issue, please do try and contact me on discord: WoW#4929

Shashank3736 commented 1 year ago

You can change the font size by using setCaptcha method in CaptchaGenerator or drawCaptcha method in Captcha class. Try using these options.

WoWisme commented 1 year ago

I tried doing that with drawCaptcha, but I feel like I don't understand how to do it correctly, cause each method I try, doesn't work. I looked through each docs, and I am using the latest of the captcha-canvas with the latest of skia-canvas, and it just change after adding skia-canvas. I even tried looking through the docs of skia-canvas, but didn't find anything there for it to change my font size. I had a look after the libfontconfig, which I have no clue where is installed, so I can't have a look at that, but if you have an example to how I use the drawCaptcha in Captcha, to change the font, that would be nice

WoWisme commented 1 year ago

In this image, I have shown you to sorts of code. The first embed with the code size 40, and the second being size 60. image

The exact same size, and I just changed as it is in the docs. code: Size 40: https://sourceb.in/CRr5xQN5Dk Size 60: https://sourceb.in/FMK1nHfgL5

Shashank3736 commented 1 year ago

hmm! weird. Try using v2.3.1 it works with canvas module so it may solve your issue. Also can you pls share your code here just the captcha-generation part.

WoWisme commented 1 year ago

https://sourceb.in/FMK1nHfgL5 This was the code. The captcha generate was at the top from line 13-26

Shashank3736 commented 1 year ago

Provide me info related to your os and node version

Also try using v2.3.1 you need to update your code a lot but it may solve your problem. You can see v2 docs here v2 do not have captcha module


npm i captcha-canvas@v2.3.1
Shashank3736 commented 1 year ago

Close due to inactivity.

Edit: If you are still facing any issues you can reopen it.