mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
added read-image
util
This commit is contained in:
parent
da1d3826e1
commit
1ef98a5d8c
9
packages/server/src/utils/read-image/index.js
Normal file
9
packages/server/src/utils/read-image/index.js
Normal 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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user