合并后的部分骰子路径修复
This commit is contained in:
@ -308,7 +308,7 @@ async def generate_dice_image(number: str) -> BytesIO:
|
|||||||
# 如果文本太长,直接返回金箍棒
|
# 如果文本太长,直接返回金箍棒
|
||||||
if(len(text) > 50):
|
if(len(text) > 50):
|
||||||
output = BytesIO()
|
output = BytesIO()
|
||||||
push_image = Image.open(ASSETS_PATH / "stick.png")
|
push_image = Image.open(ASSETS_PATH / "img" / "dice" / "stick.png")
|
||||||
push_image.save(output,format='PNG')
|
push_image.save(output,format='PNG')
|
||||||
output.seek(0)
|
output.seek(0)
|
||||||
return output
|
return output
|
||||||
@ -334,7 +334,7 @@ async def generate_dice_image(number: str) -> BytesIO:
|
|||||||
move_distance = (up_direction[0] * (stretch_k - 1), up_direction[1] * (stretch_k - 1))
|
move_distance = (up_direction[0] * (stretch_k - 1), up_direction[1] * (stretch_k - 1))
|
||||||
|
|
||||||
# 加载背景图像,保留透明通道
|
# 加载背景图像,保留透明通道
|
||||||
background = cv2.imread(ASSETS_PATH / "template.png", cv2.IMREAD_UNCHANGED)
|
background = cv2.imread(ASSETS_PATH / "img" / "dice" / "template.png", cv2.IMREAD_UNCHANGED)
|
||||||
|
|
||||||
height, width = background.shape[:2]
|
height, width = background.shape[:2]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user