mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-24 21:07:17 +00:00
[captcha] fixed size
This commit is contained in:
@@ -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))
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user