+ added helper scripts
+ moved uis into own files + log is not rerendered in full anymore
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from PIL import Image
|
||||
import os
|
||||
import sys
|
||||
|
||||
TARGET = (480, 800)
|
||||
INPUT_DIR = sys.argv[1] if len(sys.argv) > 1 else "."
|
||||
EXTENSIONS = {".jpg", ".jpeg", ".png", ".webp", ".bmp"}
|
||||
|
||||
for filename in os.listdir(INPUT_DIR):
|
||||
ext = os.path.splitext(filename)[1].lower()
|
||||
if ext not in EXTENSIONS:
|
||||
continue
|
||||
|
||||
path = os.path.join(INPUT_DIR, filename)
|
||||
img = Image.open(path)
|
||||
|
||||
img.thumbnail(TARGET, Image.LANCZOS)
|
||||
|
||||
img.save(path)
|
||||
print(f"{filename}: {img.size}")
|
||||
Reference in New Issue
Block a user