]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Remove unneded exception handler from has_alpha() 133/head
authorMartin Müller <mail@mueller-martin.net>
Mon, 21 Feb 2022 21:58:19 +0000 (22:58 +0100)
committerMartin Müller <mail@mueller-martin.net>
Mon, 21 Feb 2022 21:58:19 +0000 (22:58 +0100)
src/paperless_tesseract/parsers.py

index 02de914ce986e003f68483ad8ea1e6231e0ec4bf..c1eddcefed2f77dbcb9fccb20d75f9732f8056f8 100644 (file)
@@ -67,14 +67,8 @@ class RasterisedDocumentParser(DocumentParser):
         ]
 
     def has_alpha(self, image):
-        try:
-            with Image.open(image) as im:
-                return im.mode in ('RGBA', 'LA')
-        except Exception as e:
-            self.log(
-                'warning',
-                f"Error while check for alpha channel in image {image}: {e}")
-            return None
+        with Image.open(image) as im:
+            return im.mode in ('RGBA', 'LA')
 
     def get_dpi(self, image):
         try: