Spaces:
Sleeping
Sleeping
| import os | |
| from pathlib import Path | |
| def ensure_directory(path: str): | |
| Path(path).mkdir(parents=True, exist_ok=True) | |
| def get_file_extension(filename: str) -> str: | |
| return os.path.splitext(filename)[1].lower() | |
| def is_valid_image_extension(extension: str) -> bool: | |
| from app.core.config import settings | |
| return extension in settings.ALLOWED_EXTENSIONS | |