// https://www.npmjs.com/package/jimp
const Jimp = require('jimp')
Jimp.read(`https://readfree.me/${id}`)
  .then(lenna => {
      const url = path.join(__dirname, `../public/${id}`)
      lenna
          .resize(256, Jimp.AUTO) // resize
          .quality(90) // set JPEG quality
          .write(url) // save
  })
  .catch(err => {
      data.thumbnail = 'default.jpg'
  })

相关文章:

  • 2022-01-19
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2021-08-15
相关资源
相似解决方案