forked from rDrama/rDrama
try to fix weird error
parent
bc4290c80d
commit
e1fdd64d31
|
@ -140,7 +140,7 @@ def process_image(filename:str, v, resize=0, trim=False, uploader_id:Optional[in
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with Image.open(filename) as i:
|
with Image.open(filename) as i:
|
||||||
params = ["magick", filename, filename, "-coalesce", "-strip", "-auto-orient", "-quality", "88"]
|
params = ["magick", filename, "-coalesce", "-quality", "88", "-strip", "-auto-orient"]
|
||||||
if trim and len(list(Iterator(i))) == 1:
|
if trim and len(list(Iterator(i))) == 1:
|
||||||
params.append("-trim")
|
params.append("-trim")
|
||||||
if resize and i.width > resize:
|
if resize and i.width > resize:
|
||||||
|
@ -154,6 +154,7 @@ def process_image(filename:str, v, resize=0, trim=False, uploader_id:Optional[in
|
||||||
abort(415)
|
abort(415)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
params.append(filename)
|
||||||
try:
|
try:
|
||||||
subprocess.run(params, timeout=MAX_IMAGE_CONVERSION_TIMEOUT)
|
subprocess.run(params, timeout=MAX_IMAGE_CONVERSION_TIMEOUT)
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
|
|
Loading…
Reference in New Issue