Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

公招识别读取头像图片路径的处理似乎有问题 #11

Closed
Yangleis opened this issue Sep 14, 2022 · 2 comments
Closed

公招识别读取头像图片路径的处理似乎有问题 #11

Yangleis opened this issue Sep 14, 2022 · 2 comments

Comments

@Yangleis
Copy link

Yangleis commented Sep 14, 2022

[v0.5.4]版本中
nonebot_plugin_arktools/open_recruitment/data_source.py中
第283行
avatar = Image.open(Path().parent / "avatar" / f"{op[1]}.png").convert("RGBA").resize((128, 128)) # 头像
获取到的是nonebot运行路径下的avatar目录,可能应该改为
avatar = Image.open(Path(__file__).parent.parent / "_data" / "operator_info" / "image" / "avatar" / f"{op[1]}.png").convert("RGBA").resize((128, 128)) # 头像
此处为插件安装的目录,与自动更新下载路径一致。

@liuzj288
Copy link

[v0.5.4]版本中 nonebot_plugin_arktools/open_recruitment/data_source.py中 第283行 avatar = Image.open(Path().parent / "avatar" / f"{op[1]}.png").convert("RGBA").resize((128, 128)) # 头像 获取到的是nonebot运行路径下的avatar目录,可能应该改为 avatar = Image.open(Path(__file__).parent.parent / "_data" / "operator_info" / "image" / "avatar" / f"{op[1]}.png").convert("RGBA").resize((128, 128)) # 头像 此处为插件安装的目录,与自动更新下载路径一致。

确实,改了之后这个报错就解决了
image

@NumberSir
Copy link
Owner

[v0.5.4]版本中 nonebot_plugin_arktools/open_recruitment/data_source.py中 第283行 avatar = Image.open(Path().parent / "avatar" / f"{op[1]}.png").convert("RGBA").resize((128, 128)) # 头像 获取到的是nonebot运行路径下的avatar目录,可能应该改为 avatar = Image.open(Path(__file__).parent.parent / "_data" / "operator_info" / "image" / "avatar" / f"{op[1]}.png").convert("RGBA").resize((128, 128)) # 头像 此处为插件安装的目录,与自动更新下载路径一致。

确实,改了之后这个报错就解决了 image

[v0.5.4]版本中 nonebot_plugin_arktools/open_recruitment/data_source.py中 第283行 avatar = Image.open(Path().parent / "avatar" / f"{op[1]}.png").convert("RGBA").resize((128, 128)) # 头像 获取到的是nonebot运行路径下的avatar目录,可能应该改为 avatar = Image.open(Path(__file__).parent.parent / "_data" / "operator_info" / "image" / "avatar" / f"{op[1]}.png").convert("RGBA").resize((128, 128)) # 头像 此处为插件安装的目录,与自动更新下载路径一致。

已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants