mewebstudio / captcha

Captcha for Laravel 5/6/7/8/9/10/11
MIT License
2.46k stars 453 forks source link

3.4.2 - No encoder found for media type (application/octet-stream). #308

Open chudaozhe opened 3 months ago

chudaozhe commented 3 months ago

Version: "mews/captcha": "3.4.2"

Usage

captcha_img('flat')

Return a link

http://blog.cw.net/captcha/flat?0asroCqw

But when I access this url, I get an error

No encoder found for media type (application/octet-stream).

Am I using it the wrong way?

thelfensdrfer commented 3 months ago

I think the error comes from this line: https://github.com/mewebstudio/captcha/blob/e009e1ea9eab8fb46af1dc16b66103c056b7e30c/src/Captcha.php#L275

$this->imageManager->create, returns a octet-stream instead of an image. I just don't know if this was always the case it if it is normal to do so. I guess not.

thelfensdrfer commented 3 months ago

Version 3.3 works, > 3.4.0 does not.

HuyPham55 commented 2 months ago

Quick fix In config/captcha, for flat configuration (or any custom configuration that you are having the exception with), turn the background ON by changing:

bgImage => true //initial value: false

Worked for me

Shadecute commented 2 months ago

I'm also having this issue on the latest version with flat. Changing 'bgImage' to 'true' fixes it.

Battery9 commented 2 months ago

But i want no bg image. Instead a solid color bg. Apparently that's not possible for now?

bishutalai07 commented 1 month ago

But i want no bg image. Instead a solid color bg. Apparently that's not possible for now?

Same problem. I don't want bgImage

TxX8N8LN commented 1 month ago

Thx @HuyPham55 , same bug here, and it's work with your quick fix

echoyl commented 6 hours ago

mark