1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 14:50:29 +00:00

[captcha] fixed size

This commit is contained in:
zming
2017-07-13 12:54:00 +08:00
parent f55d23b095
commit 6cb50b9c0c
2 changed files with 2 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import os
from django.conf import settings
CAPTCHA_IMAGE_SIZE = getattr(settings, 'CAPTCHA_IMAGE_SIZE', (90,42))
CAPTCHA_FONT_PATH = getattr(settings, 'CAPTCHA_FONT_PATH', os.path.normpath(os.path.join(os.path.dirname(__file__), '..', 'fonts/Vera.ttf')))
CAPTCHA_FONT_SIZE = getattr(settings, 'CAPTCHA_FONT_SIZE', 22)
CAPTCHA_LETTER_ROTATION = getattr(settings, 'CAPTCHA_LETTER_ROTATION', (-35, 35))

View File

@@ -92,6 +92,7 @@ def captcha_image(request, key, scale=1):
for f in settings.filter_functions():
image = f(image)
image = image.resize(settings.CAPTCHA_IMAGE_SIZE, Image.ANTIALIAS)
out = StringIO()
image.save(out, "PNG")
out.seek(0)