fix: replace bare except with except Exception in image validation functions

This commit is contained in:
suraj kumar 2026-08-02 13:36:34 +05:30
parent 33e781bf7b
commit 22eeae2473
4 changed files with 4 additions and 4 deletions

View File

@ -134,7 +134,7 @@ def check_image(fn):
im = Image.open(fn)
im.verify()
return True
except:
except Exception:
return False
def check_image_dir(path):

View File

@ -48,7 +48,7 @@ def check_image(fn):
im = Image.open(fn)
im.verify()
return im.format=='JPEG'
except:
except Exception:
return False
def check_image_dir(path):

View File

@ -134,7 +134,7 @@ def check_image(fn):
im = Image.open(fn)
im.verify()
return True
except:
except Exception:
return False
def check_image_dir(path):

View File

@ -48,7 +48,7 @@ def check_image(fn):
im = Image.open(fn)
im.verify()
return im.format=='JPEG'
except:
except Exception:
return False
def check_image_dir(path):