fix: 微调gemini识图,删除本地缓存

This commit is contained in:
ikechan8370 2025-02-03 20:11:25 +08:00
parent f05da98d37
commit bbba9bc872

View file

@ -744,12 +744,9 @@ class Core {
const image = await getImg(e)
let imageUrl = image ? image[0] : undefined
if (imageUrl) {
let md5 = imageUrl.split(/[/-]/).find(s => s.length === 32)?.toUpperCase()
let imageLoc = await getOrDownloadFile(`ocr/${md5}.png`, imageUrl)
let outputLoc = imageLoc.replace(`${md5}.png`, `${md5}_512.png`)
await resizeAndCropImage(imageLoc, outputLoc, 512)
let buffer = fs.readFileSync(outputLoc)
option.image = buffer.toString('base64')
const response = await fetch(imageUrl)
const base64Image = Buffer.from(await response.arrayBuffer())
option.image = base64Image.toString('base64')
}
if (opt.enableSmart) {
/**