You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (s instanceof Image) {
String id = ((Image) s).getImageId();
ImageType type = ((Image) s).getImageType();
File imageDir = new File(
AskAndAnswerPluginMain.INSTANCE.getDataFolderPath() + "/image/" + type.getFormatName());
问题描述
数据库记录了一张图片Id:
[mirai:image:{881AD697-863A-88B1-8A00-B1E6BB9E7AB9}.jpg]
, 图片源文件也存在自己服务器的某目录下;保存代码如:然后是查询数据库与文件系统,获得构造图片信息并准备发送的代码:
日志输出:
可以看到发送时的
i.getImageType().getFormatName()
得到的是gif,但是这图片显然是jpg,且保存的时候的type.getFormatName()
能得到jpg,现在这张图片文件就是存在……/image/jpg/{881AD697-863A-88B1-8A00-B1E6BB9E7AB9}.jpg.jpg
,发送时根据变量拼接结果就到gif目录下去找了复现
见描述
mirai-core 版本
2.14.0
bot-protocol
ANDROID_PAD
其他组件版本
No response
系统日志
No response
网络日志
No response
补充信息
No response
The text was updated successfully, but these errors were encountered: