index.js
1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _omggif = _interopRequireDefault(require("omggif"));
var MIME_TYPE = 'image/gif';
var _default = function _default() {
return {
mime: (0, _defineProperty2["default"])({}, MIME_TYPE, ['gif']),
constants: {
MIME_GIF: MIME_TYPE
},
decoders: (0, _defineProperty2["default"])({}, MIME_TYPE, function (data) {
var gifObj = new _omggif["default"].GifReader(data);
var gifData = Buffer.alloc(gifObj.width * gifObj.height * 4);
gifObj.decodeAndBlitFrameRGBA(0, gifData);
return {
data: gifData,
width: gifObj.width,
height: gifObj.height
};
})
};
};
exports["default"] = _default;
module.exports = exports.default;
//# sourceMappingURL=index.js.map