优化rmbg服务的保存图片逻辑,提高效率
This commit is contained in:
parent
cecd617104
commit
9e259e7344
@ -368,7 +368,8 @@ class RmbgService:
|
||||
"""保存图片到文件并返回URL"""
|
||||
filename = f"rmbg_{uuid.uuid4().hex[:10]}.png"
|
||||
file_path = os.path.join(self.save_dir, filename)
|
||||
image.save(file_path, format="PNG")
|
||||
|
||||
image.save(file_path, format="PNG", optimize=False, compress_level=1)
|
||||
image_url = f"{self.download_url}/{filename}"
|
||||
return image_url
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user