mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
added read-image
util
This commit is contained in:
parent
ed2515a26c
commit
0cbcb93e6e
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