mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-09-17 08:47:55 -07:00
21 lines
606 B
Python
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) |