change MAX_IMAGE_SIZE_BANNER_RESIZED_MB into MAX_IMAGE_SIZE_BANNER_RESIZED_KB

master
Aevann1 2022-10-15 12:37:55 +02:00
parent 4f8f8db54f
commit f2225e700a
2 changed files with 3 additions and 3 deletions

View File

@ -394,7 +394,7 @@ GIFT_NOTIF_ID = 5
SIGNUP_FOLLOW_ID = 0
NOTIFICATION_THREAD = 1
MAX_IMAGE_SIZE_BANNER_RESIZED_MB = 0.5
MAX_IMAGE_SIZE_BANNER_RESIZED_KB = 500
MAX_IMAGE_AUDIO_SIZE_MB = 8
MAX_IMAGE_AUDIO_SIZE_MB_PATRON = 16
MAX_VIDEO_SIZE_MB = 32

View File

@ -153,9 +153,9 @@ def process_image(filename=None, resize=0, trim=False, uploader=None, patron=Fal
if resize in (300,400,1200):
if os.stat(filename).st_size > MAX_IMAGE_SIZE_BANNER_RESIZED_MB * 1024 * 1024:
if os.stat(filename).st_size > MAX_IMAGE_SIZE_BANNER_RESIZED_KB * 1024:
os.remove(filename)
abort(413, f"Max size for banners, sidebars, and badges is {MAX_IMAGE_SIZE_BANNER_RESIZED_MB}")
abort(413, f"Max size for banners, sidebars, and badges is {MAX_IMAGE_SIZE_BANNER_RESIZED_KB} KB")
if resize == 1200:
path = f'files/assets/images/{SITE_NAME}/banners'