-
Notifications
You must be signed in to change notification settings - Fork 181
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
create_captcha_image broken #63
Comments
yes facing the same issue , how to fix? |
A workaround is to pin the old Pillow version in your project's dependencies, as done here: desec-io/desec-stack@04e1470 While it works, it's suboptimal, because you will be stuck with that version of Pillow, which is no longer maintained. |
Good thing that I always test my Code before publishing it. I use this lib in a CaptchaBot for Discord. And because this doesn't throw an error in the ide, it's pretty fucked to find the issue. It only showed in the logs (logging module) and in sentry. |
@lepture a release fixing pillow 10 compatibility would be greatly appreciated. :) Especially considering that security issues in Pillow aren't that rare, having to pin an outdated version of it is somewhat dangerous. |
BTW I just gave it a quick try and there doesn't seem to be a drop-in replacement producing the same results... This got pretty close though: left, top, right, bottom = draw.textbbox((0, 0), c, font=font)
w = int((right - left)*1.7) or 1
h = int((bottom - top)*1.7) or 1 I did not have a closer look on why I need to apply a factor or get really broken results, or why a whitespace has a width/height (don't remember which one) of 0... |
@peterthomassen This should be fixed by 0.5.0 |
Thanks, I can confirm that the fixed version works fine! |
With the release of Pillow 10, the dependency of this module on Pillow (without version specifier) will now install Pillow 10.
This causes
create_captcha_image
to break:A potential fix could be pinning to an older Pillow version (will likely cause other problems), or fixing the issue itself. https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html#font-size-and-offset-methods hints at how to do that.
The text was updated successfully, but these errors were encountered: