# utils.py from PIL import Image import numpy as np import os from config import DEFAULT_IMAGE_PATH, ASSETS_DIR def ensure_placeholder_image(path=DEFAULT_IMAGE_PATH): """Creates a simple placeholder image if it doesn't exist.""" if not os.path.exists(ASSETS_DIR): os.makedirs(ASSETS_DIR, exist_ok=True) if not os.path.exists(path): # Create a simple 576x320 blue image img = Image.fromarray(np.full((320, 576, 3), [100, 100, 255], dtype=np.uint8)) img.save(path) print(f"Created placeholder image at {path}") return path