forked from MarseyWorld/MarseyWorld
remove conditions from "except" to make sure the file removal always happens
parent
023b398759
commit
9e30061d6d
|
@ -202,7 +202,7 @@ def process_image(filename:str, v, resize=0, trim=False, uploader_id:Optional[in
|
||||||
params.append("-trim")
|
params.append("-trim")
|
||||||
if resize and i.width > resize:
|
if resize and i.width > resize:
|
||||||
params.extend(["-resize", f"{resize}>"])
|
params.extend(["-resize", f"{resize}>"])
|
||||||
except UnidentifiedImageError as e:
|
except:
|
||||||
print(f"Couldn't identify an image for {filename}; deleting... (user {v.id if v else '-no user-'})")
|
print(f"Couldn't identify an image for {filename}; deleting... (user {v.id if v else '-no user-'})")
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
if has_request:
|
if has_request:
|
||||||
|
@ -305,7 +305,7 @@ def process_dm_images(v, user, body):
|
||||||
timeout=20,
|
timeout=20,
|
||||||
proxies=proxies
|
proxies=proxies
|
||||||
).json()
|
).json()
|
||||||
except requests.Timeout:
|
except:
|
||||||
abort(400, "Image upload timed out, please try again!")
|
abort(400, "Image upload timed out, please try again!")
|
||||||
|
|
||||||
try: url = req['files'][0]['url']
|
try: url = req['files'][0]['url']
|
||||||
|
|
Loading…
Reference in New Issue