Spaces:
Running
Running
File size: 468 Bytes
784f547 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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)
|