Spaces:
Runtime error
Runtime error
| import os | |
| import logging | |
| from pathlib import Path | |
| logger = logging.getLogger(__name__) | |
| # ImageMagick configuration for Hugging Face Spaces | |
| os.environ['IMAGEMAGICK_BINARY'] = '/usr/bin/magick' | |
| IMAGEMAGICK_BINARY = '/usr/bin/magick' | |
| # Validate ImageMagick path | |
| if not Path(IMAGEMAGICK_BINARY).exists(): | |
| error_msg = f"ImageMagick not found at {IMAGEMAGICK_BINARY}. Please check the installation." | |
| logger.error(error_msg) | |
| raise FileNotFoundError(error_msg) | |