captcha icon indicating copy to clipboard operation
captcha copied to clipboard

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

Open chudaozhe opened this issue 1 year ago • 6 comments
trafficstars

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?

chudaozhe avatar Aug 17 '24 06:08 chudaozhe

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 avatar Aug 21 '24 12:08 thelfensdrfer

Version 3.3 works, > 3.4.0 does not.

thelfensdrfer avatar Aug 21 '24 13:08 thelfensdrfer

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

HuyPham55 avatar Sep 03 '24 04:09 HuyPham55

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

Shadecute avatar Sep 10 '24 12:09 Shadecute

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

Battery9 avatar Sep 21 '24 06:09 Battery9

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

bishutalai07 avatar Oct 21 '24 10:10 bishutalai07

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

TxX8N8LN avatar Oct 28 '24 13:10 TxX8N8LN

mark

echoyl avatar Nov 28 '24 06:11 echoyl

For the time being, I've set bgImage to true. Could someone submit a PR to fix this?

LiXunGuan avatar Dec 06 '24 11:12 LiXunGuan

try this https://github.com/mewebstudio/captcha/pull/325

shivank44 avatar Jan 26 '25 07:01 shivank44

bgImage => true

thanks

dikiwidia avatar Feb 26 '25 14:02 dikiwidia

The issue has been resolved in version 3.4.5 , thank you for the contribution from @shivank44

chudaozhe avatar Mar 08 '25 15:03 chudaozhe