added read-image util

This commit is contained in:
srgooglo 2022-10-16 17:58:57 +02:00
parent ed2515a26c
commit 0cbcb93e6e

View File

@ -0,0 +1,9 @@
import fs from "fs"
import jpeg from "jpeg-js"
export default (path) => {
const buf = fs.readFileSync(path)
const pixels = jpeg.decode(buf, true)
return pixels
}