fix      sketch 提取修复没有文件后缀问题
This commit is contained in:
zhouchengrong
2024-10-04 17:43:08 +08:00
parent 571a84ac68
commit 4e420f8ae8

View File

@@ -53,8 +53,8 @@ class LineArtService:
def put_image(self, image): def put_image(self, image):
try: try:
image_bytes = cv2.imencode('.jpg', image)[1].tobytes() image_bytes = cv2.imencode('.jpg', image)[1].tobytes()
oss_upload_image(bucket=self.sketch_bucket, object_name=self.sketch_name, image_bytes=image_bytes) oss_upload_image(bucket=self.sketch_bucket, object_name=f"{self.sketch_name}.jpg", image_bytes=image_bytes)
return f"{self.sketch_bucket}/{self.sketch_name}" return f"{self.sketch_bucket}/{self.sketch_name}.jpg"
except Exception as e: except Exception as e:
logger.warning(e) logger.warning(e)