captcha
captcha copied to clipboard
3.4.2 - No encoder found for media type (application/octet-stream).
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?
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.
Version 3.3 works, > 3.4.0 does not.
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
I'm also having this issue on the latest version with flat. Changing 'bgImage' to 'true' fixes it.
But i want no bg image. Instead a solid color bg. Apparently that's not possible for now?
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
Thx @HuyPham55 , same bug here, and it's work with your quick fix
mark
For the time being, I've set bgImage to true. Could someone submit a PR to fix this?
try this https://github.com/mewebstudio/captcha/pull/325
bgImage => true
thanks
The issue has been resolved in version 3.4.5 , thank you for the contribution from @shivank44