Files
Marble-shell-theme/scripts/utils/is_photo.py
Vladyslav Hroshev 028f2d211d I hate GitHub Actions
2025-03-26 20:33:19 +02:00

21 lines
606 B
Python

image_extensions = [
'jpg', 'jpeg', 'png', 'gif', 'bmp',
'webp', 'tiff', 'tif', 'svg', 'heic', 'heif'
]
def is_photo(extension: str):
"""
Check if extension is supported photo format
"""
return extension.lower() in image_extensions
class NotSupportedPhotoExtension(Exception):
"""
Exception for not supported photo extension
"""
def __init__(self, extension):
self.message = (f"Photo extension {extension} is not supported. "
f"Supported formats: {', '.join(image_extensions)}.")
super().__init__(self.message)