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

Ubuntu #152

Closed
mina1917 opened this issue May 30, 2023 · 8 comments
Closed

Ubuntu #152

mina1917 opened this issue May 30, 2023 · 8 comments

Comments

@mina1917
Copy link

mina1917 commented May 30, 2023

Summary of the issue

In Ubuntu Linux Captcha not displaying image
I Did " Linux (and containers) support" this too.

net Core 6
ubuntu 22.04
DNTCaptcha.Core 4.3.3
image

@VahidN
Copy link
Owner

VahidN commented May 30, 2023

You should checkout the server's logs and at least you should see what's the response of the requested image. Open the network's tab of the browser's developer tools and see the responses.
If you want to see the output of _logger.LogDebug, you should turn on this level of logging in the appsettings.json file.

@mina1917
Copy link
Author

"GET /DNTCaptchaImage/Show?data=Lq3czSmPZ4-ohUzc_YK2e61LhT3DNUM1gPIaQo1mN_qo6chFrNMUkntpxoaQDfs1eYkg1FidTeKByuqmL87OGw HTTP/1.1" 400 Bad Request

@mina1917
Copy link
Author

mina1917 commented May 30, 2023

On my local and windows host, everthing works well but I've had problems on ubuntu linux and the image doesn't display properly

Error is : Couldn't deserialize the model.

@VahidN
Copy link
Owner

VahidN commented May 30, 2023

Error is : Couldn't deserialize the model.

This means something is cutting/changing some parts of the query string and on the server, this corrupted data can't be decrypted properly. Do you have any filter here such as LowercaseQueryStrings = true?

@mina1917
Copy link
Author

I found this in my logs :

Failed to show the captcha image.
May 30 16:59:08 localhost netcore-demo[286782]: SixLabors.Fonts.FontFamilyNotFoundException: Tahoma could not be found
May 30 16:59:08 localhost netcore-demo[286782]: at SixLabors.Fonts.FontCollection.GetImpl(String name, CultureInfo culture)
May 30 16:59:08 localhost netcore-demo[286782]: at DNTCaptcha.Core.CaptchaImageProvider.getFont(String fontName, Single fontSize) in D:\Prog\1395\DNTCaptcha.Core\src\DNTCaptcha.Core\CaptchaImageProvider.cs:line 113
May 30 16:59:08 localhost netcore-demo[286782]: at DNTCaptcha.Core.CaptchaImageProvider.DrawCaptcha(String message, String foreColor, String backColor, Single fontSize, String fontName) in D:\Prog\1395\DNTCaptcha.Core\src\DNTCaptcha.Core\CaptchaImageProvider.cs:line 53
May 30 16:59:08 localhost netcore-demo[286782]: at DNTCaptcha.Core.DNTCaptchaImageController.Show(String data) in D:\Prog\1395\DNTCaptcha.Core\src\DNTCaptcha.Core\DNTCaptchaImageController.cs:line 191

@VahidN
Copy link
Owner

VahidN commented May 30, 2023

  • The last version is not using the SixLabors anymore. It's SkiaSharp.
  • Tahoma font is not installed on Linux systems. You should define a custom font here.

@mina1917
Copy link
Author

I use this version Include="DNTCaptcha.Core" Version="4.3.3"
you mean if I use the last version, it will be fixed?

@VahidN
Copy link
Owner

VahidN commented May 30, 2023

You should use a custom font for Linux systems, because they don't have the Tahoma by default.

@VahidN VahidN closed this as completed May 30, 2023
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

2 participants