[Update] BotCommandProcess 补充Javadoc;

[Change] PixivUgoiraBuilder 调整日志输出级别;
This commit is contained in:
LamGC 2020-04-26 15:45:23 +08:00
parent c6952de84c
commit d549c5674d
2 changed files with 7 additions and 1 deletions

View File

@ -568,6 +568,12 @@ public class BotCommandProcess {
return getImageToBotCode(imageCache.get(fileName), false).toString(); return getImageToBotCode(imageCache.get(fileName), false).toString();
} }
/**
* 通过文件获取图片的BotCode代码
* @param targetFile 图片文件
* @param updateCache 是否刷新缓存(只是让机器人重新上传, 如果上传接口有重复检测的话是无法处理的)
* @return 返回设定好参数的BotCode
*/
private static BotCode getImageToBotCode(File targetFile, boolean updateCache) { private static BotCode getImageToBotCode(File targetFile, boolean updateCache) {
String fileName = targetFile.getName(); String fileName = targetFile.getName();
BotCode code = BotCode.parse(CQCode.image(getImageStoreDir().getName() + "/" + fileName)); BotCode code = BotCode.parse(CQCode.image(getImageStoreDir().getName() + "/" + fileName));

View File

@ -135,7 +135,7 @@ public final class PixivUgoiraBuilder {
image.getRGB(0, 0, image.getWidth(), image.getHeight(), rgb, 0, image.getWidth()); image.getRGB(0, 0, image.getWidth(), image.getHeight(), rgb, 0, image.getWidth());
log.trace("帧解析完成, 正在插入..."); log.trace("帧解析完成, 正在插入...");
encoder.addImage(Image.fromRgb(rgb, image.getWidth()), new ImageOptions().setDelay(frameInfo.get("delay").getAsLong(), TimeUnit.MILLISECONDS)); encoder.addImage(Image.fromRgb(rgb, image.getWidth()), new ImageOptions().setDelay(frameInfo.get("delay").getAsLong(), TimeUnit.MILLISECONDS));
log.debug("帧 {} 插入完成.", frameFileName); log.trace("帧 {} 插入完成.", frameFileName);
} catch (IOException e) { } catch (IOException e) {
log.error("解析帧图片数据时发生异常", e); log.error("解析帧图片数据时发生异常", e);
} }