You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

14 lines
325 B

let p = console.log
const sharp = require 'sharp'
import links from '../app/community_links'
def main
for link in links
data = link.icon.replace(/data:.*base64,/, '')
p data.slice(0, 10)
let buf = Buffer.from(data, 'base64')
buf = await sharp(buf).resize(20, 20).toBuffer!
p buf
# p x.toString("base64")
main!