mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 17:17:26 +01:00
Remove unneded exception handler from has_alpha()
This commit is contained in:
parent
73a8569d21
commit
1e288100a9
1 changed files with 2 additions and 8 deletions
|
|
@ -67,14 +67,8 @@ class RasterisedDocumentParser(DocumentParser):
|
||||||
]
|
]
|
||||||
|
|
||||||
def has_alpha(self, image):
|
def has_alpha(self, image):
|
||||||
try:
|
|
||||||
with Image.open(image) as im:
|
with Image.open(image) as im:
|
||||||
return im.mode in ('RGBA', 'LA')
|
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
|
|
||||||
|
|
||||||
def get_dpi(self, image):
|
def get_dpi(self, image):
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue