Compare commits
3 Commits
d781c853f8
...
1a4600bd95
Author | SHA1 | Date |
---|---|---|
Aevann1 | 1a4600bd95 | |
Aevann1 | 5d2dbee95e | |
Aevann1 | ab51e97e09 |
|
@ -471,7 +471,7 @@ MAX_IMAGE_AUDIO_SIZE_MB = 8
|
|||
MAX_IMAGE_AUDIO_SIZE_MB_PATRON = 16
|
||||
MAX_VIDEO_SIZE_MB = 32
|
||||
MAX_VIDEO_SIZE_MB_PATRON = 64
|
||||
MAX_IMAGE_CONVERSION_TIMEOUT = 15 # seconds
|
||||
MAX_IMAGE_CONVERSION_TIMEOUT = 30 # seconds
|
||||
|
||||
ANTISPAM_BYPASS_IDS = set()
|
||||
|
||||
|
|
|
@ -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 uploading elsewhere."))
|
||||
"Please convert it to WEBP elsewhere then upload it again."))
|
||||
return None
|
||||
|
||||
if resize:
|
||||
|
|
Loading…
Reference in New Issue