forked from MarseyWorld/MarseyWorld
imagemagick is really cringe
parent
5d2dbee95e
commit
1a4600bd95
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue