PCM: don't rescale uploaded banners.

master
Snakes 2022-10-07 21:13:57 -04:00
parent 6750a156fd
commit 556b3e3c4e
Signed by: Snakes
GPG Key ID: E745A82778055C7E
1 changed files with 2 additions and 1 deletions

View File

@ -206,12 +206,13 @@ def comment(v):
copyfile(oldname, filename) copyfile(oldname, filename)
process_image(filename, resize=400) process_image(filename, resize=400)
elif parent_post.id == BANNER_THREAD: elif parent_post.id == BANNER_THREAD:
banner_width = 1200 if not SITE_NAME == 'PCM' else 0
li = sorted(os.listdir(f'files/assets/images/{SITE_NAME}/banners'), li = sorted(os.listdir(f'files/assets/images/{SITE_NAME}/banners'),
key=lambda e: int(e.split('.webp')[0]))[-1] key=lambda e: int(e.split('.webp')[0]))[-1]
num = int(li.split('.webp')[0]) + 1 num = int(li.split('.webp')[0]) + 1
filename = f'files/assets/images/{SITE_NAME}/banners/{num}.webp' filename = f'files/assets/images/{SITE_NAME}/banners/{num}.webp'
copyfile(oldname, filename) copyfile(oldname, filename)
process_image(filename, resize=1200) process_image(filename, resize=banner_width)
elif parent_post.id == BADGE_THREAD: elif parent_post.id == BADGE_THREAD:
try: try:
badge_def = loads(body) badge_def = loads(body)