aboutsummaryrefslogtreecommitdiffstats
path: root/bsie/reader/image
diff options
context:
space:
mode:
Diffstat (limited to 'bsie/reader/image')
-rw-r--r--bsie/reader/image/_pillow.py2
-rw-r--r--bsie/reader/image/_raw.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/bsie/reader/image/_pillow.py b/bsie/reader/image/_pillow.py
index ee0662d..3144509 100644
--- a/bsie/reader/image/_pillow.py
+++ b/bsie/reader/image/_pillow.py
@@ -31,6 +31,8 @@ class PillowImage(base.Reader):
try:
# open file with PIL
return PIL.Image.open(path)
+ except PIL.UnidentifiedImageError as err:
+ raise errors.UnsupportedFileFormatError(path) from err
except IOError as err:
raise errors.ReaderError(path) from err
diff --git a/bsie/reader/image/_raw.py b/bsie/reader/image/_raw.py
index 77be357..cd60453 100644
--- a/bsie/reader/image/_raw.py
+++ b/bsie/reader/image/_raw.py
@@ -45,7 +45,7 @@ class RawImage(base.Reader):
def __call__(self, path: str) -> PIL.Image:
# perform quick checks first
if not self._match(path):
- raise errors.ReaderError(path)
+ raise errors.UnsupportedFileFormatError(path)
try:
# open file with rawpy