thedesk/app/node_modules/exif-parser/index.js
2019-09-12 23:38:13 +09:00

19 lines
526 B
JavaScript

var Parser = require('./lib/parser');
function getGlobal() {
return (1,eval)('this');
}
module.exports = {
create: function(buffer, global) {
global = global || getGlobal();
if(buffer instanceof global.ArrayBuffer) {
var DOMBufferStream = require('./lib/dom-bufferstream');
return new Parser(new DOMBufferStream(buffer, 0, buffer.byteLength, true, global));
} else {
var NodeBufferStream = require('./lib/bufferstream');
return new Parser(new NodeBufferStream(buffer, 0, buffer.length, true));
}
}
};