only check duplicates for banners, sidebar images, and badges
parent
77e5da55ef
commit
834f70fd2d
|
@ -157,11 +157,13 @@ def process_image(filename=None, resize=0, trim=False, uploader=None, patron=Fal
|
|||
if resize:
|
||||
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_KB} KB")
|
||||
abort(413, f"Max size for site assets is {MAX_IMAGE_SIZE_BANNER_RESIZED_KB} KB")
|
||||
|
||||
if filename.startswith('files/assets/images/'):
|
||||
path = filename.rsplit('/', 1)[0]
|
||||
kind = path.split('/')[-1]
|
||||
|
||||
if kind in ('banners','sidebar','badges'):
|
||||
hashes = {}
|
||||
|
||||
for img in os.listdir(path):
|
||||
|
|
Loading…
Reference in New Issue