forked from MarseyWorld/MarseyWorld
change MAX_IMAGE_SIZE_BANNER_RESIZED_MB into MAX_IMAGE_SIZE_BANNER_RESIZED_KB
parent
4f8f8db54f
commit
f2225e700a
|
@ -394,7 +394,7 @@ GIFT_NOTIF_ID = 5
|
||||||
SIGNUP_FOLLOW_ID = 0
|
SIGNUP_FOLLOW_ID = 0
|
||||||
NOTIFICATION_THREAD = 1
|
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 = 8
|
||||||
MAX_IMAGE_AUDIO_SIZE_MB_PATRON = 16
|
MAX_IMAGE_AUDIO_SIZE_MB_PATRON = 16
|
||||||
MAX_VIDEO_SIZE_MB = 32
|
MAX_VIDEO_SIZE_MB = 32
|
||||||
|
|
|
@ -153,9 +153,9 @@ def process_image(filename=None, resize=0, trim=False, uploader=None, patron=Fal
|
||||||
|
|
||||||
|
|
||||||
if resize in (300,400,1200):
|
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)
|
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:
|
if resize == 1200:
|
||||||
path = f'files/assets/images/{SITE_NAME}/banners'
|
path = f'files/assets/images/{SITE_NAME}/banners'
|
||||||
|
|
Loading…
Reference in New Issue