代码:
console.log("开始加载图片:" + urlthumb);
var img = images.load(urlthumb, function(err, result) {
if (err) {
console.error("加载图片失败:" + err.message);
return;
}
console.log("图片加载成功,开始保存:" + photoPath);
images.save(result, photoPath, { format: 'jpeg', quality: 90 }, function(err) {
if (err) {
console.error("保存图片失败:" + err.message);
return;
}
console.log("图片保存成功!");
});
});
报错结果:
16:38:35.535/D: 开始加载图片:https://www.gamejoyfull.com/uploads/gamepic/20230710/d1786099a853a1040f85a699b89a7f5f.jpeg
16:38:35.578/E: Can't find method com.stardust.autojs.runtime.api.Images.load(string,function). ([remote]test#59)
Can't find method com.stardust.autojs.runtime.api.Images.load(string,function).
at ImgSearch ([remote]test:59:0)
at main ([remote]test:8:0)
at [remote]test:4:0