imagemagick is really cringe

master
Aevann1 2022-12-07 10:42:23 +02:00
parent 5d2dbee95e
commit 1a4600bd95
1 changed files with 2 additions and 3 deletions

View File

@ -143,8 +143,7 @@ def process_image(filename:str, v, resize=0, trim=False, uploader_id:Optional[in
try:
with Image.open(filename) as i:
params = ["magick", filename]
if i.format.lower() != 'webp':
params.extend(["-coalesce", "-quality", "88", "-define", "webp:method=5"])
params.extend(["-coalesce", "-quality", "88"])
if trim and len(list(Iterator(i))) == 1:
params.append("-trim")
if resize and i.width > resize:
@ -165,7 +164,7 @@ def process_image(filename:str, v, resize=0, trim=False, uploader_id:Optional[in
except subprocess.TimeoutExpired:
if has_request:
abort(413, ("An uploaded image took too long to convert to WEBP. "
"Consider converting it to WEBP elsewhere then uploading it."))
"Please convert it to WEBP elsewhere then upload it again."))
return None
if resize: