A suite to track Project Diva score statistics and ratings / D4DJ event data.
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.
projectdivar/server/node_modules/image-decode/jpg.js

23 lines
374 B

// decode jpeg buffer
'use strict'
var jpeg = require('jpeg-js')
var b2u8 = require('buffer-to-uint8array')
module.exports = read
function read (data, o) {
var jpegData = jpeg.decode(data)
if(!jpegData) {
throw new Error("Error decoding jpeg")
}
return {
data: b2u8(jpegData.data),
height: jpegData.height,
width: jpegData.width
}
}