This commit is contained in:
11
node_modules/@jimp/png/CHANGELOG.md
generated
vendored
Normal file
11
node_modules/@jimp/png/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# v0.9.3 (Tue Nov 26 2019)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- `@jimp/cli`, `@jimp/core`, `@jimp/custom`, `jimp`, `@jimp/plugin-blit`, `@jimp/plugin-blur`, `@jimp/plugin-circle`, `@jimp/plugin-color`, `@jimp/plugin-contain`, `@jimp/plugin-cover`, `@jimp/plugin-crop`, `@jimp/plugin-displace`, `@jimp/plugin-dither`, `@jimp/plugin-fisheye`, `@jimp/plugin-flip`, `@jimp/plugin-gaussian`, `@jimp/plugin-invert`, `@jimp/plugin-mask`, `@jimp/plugin-normalize`, `@jimp/plugin-print`, `@jimp/plugin-resize`, `@jimp/plugin-rotate`, `@jimp/plugin-scale`, `@jimp/plugin-shadow`, `@jimp/plugin-threshold`, `@jimp/plugins`, `@jimp/test-utils`, `@jimp/bmp`, `@jimp/gif`, `@jimp/jpeg`, `@jimp/png`, `@jimp/tiff`, `@jimp/types`, `@jimp/utils`
|
||||
- Fix regeneratorRuntime errors [#815](https://github.com/oliver-moran/jimp/pull/815) ([@crutchcorn](https://github.com/crutchcorn) [@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
|
||||
#### Authors: 2
|
||||
|
||||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
- Corbin Crutchley ([@crutchcorn](https://github.com/crutchcorn))
|
||||
21
node_modules/@jimp/png/LICENSE
generated
vendored
Normal file
21
node_modules/@jimp/png/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Oliver Moran
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
35
node_modules/@jimp/png/README.md
generated
vendored
Normal file
35
node_modules/@jimp/png/README.md
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<div align="center">
|
||||
<img width="200" height="200"
|
||||
src="https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-11/256/crayon.png">
|
||||
<h1>@jimp/png</h1>
|
||||
<p>Default Jimp png encoder/decoder.</p>
|
||||
</div>
|
||||
|
||||
## Available Methods
|
||||
|
||||
### Jimp.deflateLevel
|
||||
|
||||
Sets the deflate level used when saving as PNG format (default is 9)
|
||||
|
||||
### Jimp.deflateStrategy
|
||||
|
||||
Sets the deflate strategy used when saving as PNG format (default is 3)
|
||||
|
||||
### Jimp.filterType
|
||||
|
||||
Sets the filter type used when saving as PNG format (default is automatic filters)
|
||||
|
||||
### Jimp.colorType
|
||||
|
||||
Sets the color type used when saving as PNG format (one of 0, 2, 4, 6)
|
||||
|
||||
### Filter Types
|
||||
|
||||
```js
|
||||
Jimp.PNG_FILTER_AUTO;
|
||||
Jimp.PNG_FILTER_NONE;
|
||||
Jimp.PNG_FILTER_SUB;
|
||||
Jimp.PNG_FILTER_UP;
|
||||
Jimp.PNG_FILTER_AVERAGE;
|
||||
Jimp.PNG_FILTER_PATH;
|
||||
```
|
||||
161
node_modules/@jimp/png/es/index.js
generated
vendored
Normal file
161
node_modules/@jimp/png/es/index.js
generated
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
"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 _pngjs = require("pngjs");
|
||||
|
||||
var _utils = require("@jimp/utils");
|
||||
|
||||
var MIME_TYPE = 'image/png'; // PNG filter types
|
||||
|
||||
var PNG_FILTER_AUTO = -1;
|
||||
var PNG_FILTER_NONE = 0;
|
||||
var PNG_FILTER_SUB = 1;
|
||||
var PNG_FILTER_UP = 2;
|
||||
var PNG_FILTER_AVERAGE = 3;
|
||||
var PNG_FILTER_PATH = 4;
|
||||
|
||||
var _default = function _default() {
|
||||
return {
|
||||
mime: (0, _defineProperty2["default"])({}, MIME_TYPE, ['png']),
|
||||
constants: {
|
||||
MIME_PNG: MIME_TYPE,
|
||||
PNG_FILTER_AUTO: PNG_FILTER_AUTO,
|
||||
PNG_FILTER_NONE: PNG_FILTER_NONE,
|
||||
PNG_FILTER_SUB: PNG_FILTER_SUB,
|
||||
PNG_FILTER_UP: PNG_FILTER_UP,
|
||||
PNG_FILTER_AVERAGE: PNG_FILTER_AVERAGE,
|
||||
PNG_FILTER_PATH: PNG_FILTER_PATH
|
||||
},
|
||||
hasAlpha: (0, _defineProperty2["default"])({}, MIME_TYPE, true),
|
||||
decoders: (0, _defineProperty2["default"])({}, MIME_TYPE, _pngjs.PNG.sync.read),
|
||||
encoders: (0, _defineProperty2["default"])({}, MIME_TYPE, function (data) {
|
||||
var png = new _pngjs.PNG({
|
||||
width: data.bitmap.width,
|
||||
height: data.bitmap.height
|
||||
});
|
||||
png.data = data.bitmap.data;
|
||||
return _pngjs.PNG.sync.write(png, {
|
||||
width: data.bitmap.width,
|
||||
height: data.bitmap.height,
|
||||
deflateLevel: data._deflateLevel,
|
||||
deflateStrategy: data._deflateStrategy,
|
||||
filterType: data._filterType,
|
||||
colorType: typeof data._colorType === 'number' ? data._colorType : data._rgba ? 6 : 2,
|
||||
inputHasAlpha: data._rgba
|
||||
});
|
||||
}),
|
||||
"class": {
|
||||
_deflateLevel: 9,
|
||||
_deflateStrategy: 3,
|
||||
_filterType: PNG_FILTER_AUTO,
|
||||
_colorType: null,
|
||||
|
||||
/**
|
||||
* Sets the deflate level used when saving as PNG format (default is 9)
|
||||
* @param {number} l Deflate level to use 0-9. 0 is no compression. 9 (default) is maximum compression.
|
||||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
|
||||
* @returns {Jimp} this for chaining of methods
|
||||
*/
|
||||
deflateLevel: function deflateLevel(l, cb) {
|
||||
if (typeof l !== 'number') {
|
||||
return _utils.throwError.call(this, 'l must be a number', cb);
|
||||
}
|
||||
|
||||
if (l < 0 || l > 9) {
|
||||
return _utils.throwError.call(this, 'l must be a number 0 - 9', cb);
|
||||
}
|
||||
|
||||
this._deflateLevel = Math.round(l);
|
||||
|
||||
if ((0, _utils.isNodePattern)(cb)) {
|
||||
cb.call(this, null, this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the deflate strategy used when saving as PNG format (default is 3)
|
||||
* @param {number} s Deflate strategy to use 0-3.
|
||||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
|
||||
* @returns {Jimp} this for chaining of methods
|
||||
*/
|
||||
deflateStrategy: function deflateStrategy(s, cb) {
|
||||
if (typeof s !== 'number') {
|
||||
return _utils.throwError.call(this, 's must be a number', cb);
|
||||
}
|
||||
|
||||
if (s < 0 || s > 3) {
|
||||
return _utils.throwError.call(this, 's must be a number 0 - 3', cb);
|
||||
}
|
||||
|
||||
this._deflateStrategy = Math.round(s);
|
||||
|
||||
if ((0, _utils.isNodePattern)(cb)) {
|
||||
cb.call(this, null, this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the filter type used when saving as PNG format (default is automatic filters)
|
||||
* @param {number} f The quality to use -1-4.
|
||||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
|
||||
* @returns {Jimp} this for chaining of methods
|
||||
*/
|
||||
filterType: function filterType(f, cb) {
|
||||
if (typeof f !== 'number') {
|
||||
return _utils.throwError.call(this, 'n must be a number', cb);
|
||||
}
|
||||
|
||||
if (f < -1 || f > 4) {
|
||||
return _utils.throwError.call(this, 'n must be -1 (auto) or a number 0 - 4', cb);
|
||||
}
|
||||
|
||||
this._filterType = Math.round(f);
|
||||
|
||||
if ((0, _utils.isNodePattern)(cb)) {
|
||||
cb.call(this, null, this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the color type used when saving as PNG format
|
||||
* @param {number} s color type to use 0, 2, 4, 6.
|
||||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
|
||||
* @returns {Jimp} this for chaining of methods
|
||||
*/
|
||||
colorType: function colorType(s, cb) {
|
||||
if (typeof s !== 'number') {
|
||||
return _utils.throwError.call(this, 's must be a number', cb);
|
||||
}
|
||||
|
||||
if (s !== 0 && s !== 2 && s !== 4 && s !== 6) {
|
||||
return _utils.throwError.call(this, 's must be a number 0, 2, 4, 6.', cb);
|
||||
}
|
||||
|
||||
this._colorType = Math.round(s);
|
||||
|
||||
if ((0, _utils.isNodePattern)(cb)) {
|
||||
cb.call(this, null, this);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
exports["default"] = _default;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@jimp/png/es/index.js.map
generated
vendored
Normal file
1
node_modules/@jimp/png/es/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
41
node_modules/@jimp/png/index.d.ts
generated
vendored
Normal file
41
node_modules/@jimp/png/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { DecoderFn, EncoderFn, ImageCallback } from '@jimp/core';
|
||||
|
||||
interface PNGClass {
|
||||
_deflateLevel: number,
|
||||
_deflateStrategy: number,
|
||||
_filterType: number,
|
||||
_colorType: number,
|
||||
deflateLevel(l: number, cb?: ImageCallback<this>): this;
|
||||
deflateStrategy(s: number, cb?: ImageCallback<this>): this;
|
||||
filterType(f: number, cb?: ImageCallback<this>): this;
|
||||
colorType(s: number, cb?: ImageCallback<this>): this;
|
||||
}
|
||||
|
||||
interface PNG {
|
||||
|
||||
mime: { 'image/png': string[] },
|
||||
|
||||
hasAlpha: { 'image/png': true },
|
||||
|
||||
decoders: {
|
||||
'image/png': DecoderFn
|
||||
}
|
||||
encoders: {
|
||||
'image/png': EncoderFn
|
||||
}
|
||||
|
||||
class: PNGClass
|
||||
|
||||
constants: {
|
||||
MIME_PNG: 'image/png';
|
||||
// PNG filter types
|
||||
PNG_FILTER_AUTO: -1;
|
||||
PNG_FILTER_NONE: 0;
|
||||
PNG_FILTER_SUB: 1;
|
||||
PNG_FILTER_UP: 2;
|
||||
PNG_FILTER_AVERAGE: 3;
|
||||
PNG_FILTER_PATH: 4;
|
||||
}
|
||||
}
|
||||
|
||||
export default function(): PNG;
|
||||
39
node_modules/@jimp/png/package.json
generated
vendored
Normal file
39
node_modules/@jimp/png/package.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "@jimp/png",
|
||||
"version": "0.10.3",
|
||||
"description": "Default Jimp png encoder/decoder.",
|
||||
"main": "dist/index.js",
|
||||
"module": "es/index.js",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {
|
||||
"test": "cross-env BABEL_ENV=test mocha --require @babel/register",
|
||||
"test:watch": "npm run test -- --reporter min --watch",
|
||||
"test:coverage": "nyc npm run test",
|
||||
"build": "npm run build:node:production && npm run build:module",
|
||||
"build:watch": "npm run build:node:debug -- -- --watch --verbose",
|
||||
"build:debug": "npm run build:node:debug",
|
||||
"build:module": "cross-env BABEL_ENV=module babel src -d es --source-maps --config-file ../../babel.config.js",
|
||||
"build:node": "babel src -d dist --source-maps --config-file ../../babel.config.js",
|
||||
"build:node:debug": "cross-env BABEL_ENV=development npm run build:node",
|
||||
"build:node:production": "cross-env BABEL_ENV=production npm run build:node"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.7.2",
|
||||
"@jimp/utils": "^0.10.3",
|
||||
"core-js": "^3.4.1",
|
||||
"pngjs": "^3.3.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@jimp/custom": ">=0.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jimp/custom": "^0.10.3",
|
||||
"@jimp/test-utils": "^0.10.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "37197106eae5c26231018dfdc0254422f6b43927"
|
||||
}
|
||||
159
node_modules/@jimp/png/src/index.js
generated
vendored
Normal file
159
node_modules/@jimp/png/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,159 @@
|
||||
import { PNG } from 'pngjs';
|
||||
import { throwError, isNodePattern } from '@jimp/utils';
|
||||
|
||||
const MIME_TYPE = 'image/png';
|
||||
|
||||
// PNG filter types
|
||||
const PNG_FILTER_AUTO = -1;
|
||||
const PNG_FILTER_NONE = 0;
|
||||
const PNG_FILTER_SUB = 1;
|
||||
const PNG_FILTER_UP = 2;
|
||||
const PNG_FILTER_AVERAGE = 3;
|
||||
const PNG_FILTER_PATH = 4;
|
||||
|
||||
export default () => ({
|
||||
mime: { [MIME_TYPE]: ['png'] },
|
||||
|
||||
constants: {
|
||||
MIME_PNG: MIME_TYPE,
|
||||
PNG_FILTER_AUTO,
|
||||
PNG_FILTER_NONE,
|
||||
PNG_FILTER_SUB,
|
||||
PNG_FILTER_UP,
|
||||
PNG_FILTER_AVERAGE,
|
||||
PNG_FILTER_PATH
|
||||
},
|
||||
|
||||
hasAlpha: { [MIME_TYPE]: true },
|
||||
decoders: { [MIME_TYPE]: PNG.sync.read },
|
||||
encoders: {
|
||||
[MIME_TYPE]: data => {
|
||||
const png = new PNG({
|
||||
width: data.bitmap.width,
|
||||
height: data.bitmap.height
|
||||
});
|
||||
|
||||
png.data = data.bitmap.data;
|
||||
|
||||
return PNG.sync.write(png, {
|
||||
width: data.bitmap.width,
|
||||
height: data.bitmap.height,
|
||||
deflateLevel: data._deflateLevel,
|
||||
deflateStrategy: data._deflateStrategy,
|
||||
filterType: data._filterType,
|
||||
colorType:
|
||||
typeof data._colorType === 'number'
|
||||
? data._colorType
|
||||
: data._rgba
|
||||
? 6
|
||||
: 2,
|
||||
inputHasAlpha: data._rgba
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
class: {
|
||||
_deflateLevel: 9,
|
||||
_deflateStrategy: 3,
|
||||
_filterType: PNG_FILTER_AUTO,
|
||||
_colorType: null,
|
||||
|
||||
/**
|
||||
* Sets the deflate level used when saving as PNG format (default is 9)
|
||||
* @param {number} l Deflate level to use 0-9. 0 is no compression. 9 (default) is maximum compression.
|
||||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
|
||||
* @returns {Jimp} this for chaining of methods
|
||||
*/
|
||||
deflateLevel(l, cb) {
|
||||
if (typeof l !== 'number') {
|
||||
return throwError.call(this, 'l must be a number', cb);
|
||||
}
|
||||
|
||||
if (l < 0 || l > 9) {
|
||||
return throwError.call(this, 'l must be a number 0 - 9', cb);
|
||||
}
|
||||
|
||||
this._deflateLevel = Math.round(l);
|
||||
|
||||
if (isNodePattern(cb)) {
|
||||
cb.call(this, null, this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the deflate strategy used when saving as PNG format (default is 3)
|
||||
* @param {number} s Deflate strategy to use 0-3.
|
||||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
|
||||
* @returns {Jimp} this for chaining of methods
|
||||
*/
|
||||
deflateStrategy(s, cb) {
|
||||
if (typeof s !== 'number') {
|
||||
return throwError.call(this, 's must be a number', cb);
|
||||
}
|
||||
|
||||
if (s < 0 || s > 3) {
|
||||
return throwError.call(this, 's must be a number 0 - 3', cb);
|
||||
}
|
||||
|
||||
this._deflateStrategy = Math.round(s);
|
||||
|
||||
if (isNodePattern(cb)) {
|
||||
cb.call(this, null, this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the filter type used when saving as PNG format (default is automatic filters)
|
||||
* @param {number} f The quality to use -1-4.
|
||||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
|
||||
* @returns {Jimp} this for chaining of methods
|
||||
*/
|
||||
filterType(f, cb) {
|
||||
if (typeof f !== 'number') {
|
||||
return throwError.call(this, 'n must be a number', cb);
|
||||
}
|
||||
|
||||
if (f < -1 || f > 4) {
|
||||
return throwError.call(
|
||||
this,
|
||||
'n must be -1 (auto) or a number 0 - 4',
|
||||
cb
|
||||
);
|
||||
}
|
||||
|
||||
this._filterType = Math.round(f);
|
||||
|
||||
if (isNodePattern(cb)) {
|
||||
cb.call(this, null, this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
/**
|
||||
* Sets the color type used when saving as PNG format
|
||||
* @param {number} s color type to use 0, 2, 4, 6.
|
||||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
|
||||
* @returns {Jimp} this for chaining of methods
|
||||
*/ colorType(s, cb) {
|
||||
if (typeof s !== 'number') {
|
||||
return throwError.call(this, 's must be a number', cb);
|
||||
}
|
||||
|
||||
if (s !== 0 && s !== 2 && s !== 4 && s !== 6) {
|
||||
return throwError.call(this, 's must be a number 0, 2, 4, 6.', cb);
|
||||
}
|
||||
|
||||
this._colorType = Math.round(s);
|
||||
|
||||
if (isNodePattern(cb)) {
|
||||
cb.call(this, null, this);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
});
|
||||
BIN
node_modules/@jimp/png/test/images/dice.png
generated
vendored
Normal file
BIN
node_modules/@jimp/png/test/images/dice.png
generated
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 213 KiB |
BIN
node_modules/@jimp/png/test/images/options.png
generated
vendored
Normal file
BIN
node_modules/@jimp/png/test/images/options.png
generated
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 99 B |
97
node_modules/@jimp/png/test/png.test.js
generated
vendored
Normal file
97
node_modules/@jimp/png/test/png.test.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
import { Jimp, getTestDir } from '@jimp/test-utils';
|
||||
import configure from '@jimp/custom';
|
||||
|
||||
import png from '../src';
|
||||
|
||||
const jimp = configure({ types: [png] }, Jimp);
|
||||
|
||||
describe('PNG', () => {
|
||||
const imagesDir = getTestDir(__dirname) + '/images';
|
||||
|
||||
it('load PNG', async () => {
|
||||
const image = await jimp.read(imagesDir + '/dice.png');
|
||||
|
||||
image.getPixelColor(10, 10).should.be.equal(0x00000000);
|
||||
image.getPixelColor(160, 80).should.be.equal(0x1c1cd4ff);
|
||||
image.getPixelColor(400, 250).should.be.equal(0x7e0c0cda);
|
||||
});
|
||||
|
||||
it('export PNG', async () => {
|
||||
const jgd = await jimp.read({
|
||||
width: 3,
|
||||
height: 3,
|
||||
data: [
|
||||
0xff0000ff,
|
||||
0xff0080ff,
|
||||
0xff00ffff,
|
||||
0xff0080ff,
|
||||
0xff00ffff,
|
||||
0x8000ffff,
|
||||
0xff00ffff,
|
||||
0x8000ffff,
|
||||
0x0000ffff
|
||||
]
|
||||
});
|
||||
const buffer = await jgd.getBufferAsync('image/png');
|
||||
|
||||
buffer.toString().should.match(/^.PNG\r\n/);
|
||||
});
|
||||
|
||||
it('should use png options', async () => {
|
||||
const jgd = await jimp.read({
|
||||
width: 20,
|
||||
height: 20,
|
||||
data: [
|
||||
0xff0000ff,
|
||||
0xff0080ff,
|
||||
0xff00ffff,
|
||||
0xff0080ff,
|
||||
0xff00ffff,
|
||||
0x8000ffff,
|
||||
0xff00ffff,
|
||||
0x8000ffff,
|
||||
0x0000ffff,
|
||||
0xff0000ff,
|
||||
0xff0080ff,
|
||||
0xff00ffff,
|
||||
0xff0080ff,
|
||||
0xff00ffff,
|
||||
0x8000ffff,
|
||||
0xff00ffff,
|
||||
0x8000ffff,
|
||||
0x0000ffff,
|
||||
0xff0000ff,
|
||||
0xff0080ff,
|
||||
0xff00ffff,
|
||||
0xff0080ff,
|
||||
0xff00ffff,
|
||||
0x8000ffff,
|
||||
0xff00ffff,
|
||||
0x8000ffff,
|
||||
0x0000ffff,
|
||||
0xff0000ff,
|
||||
0xff0080ff,
|
||||
0xff00ffff,
|
||||
0xff0080ff,
|
||||
0xff00ffff,
|
||||
0x8000ffff,
|
||||
0xff00ffff,
|
||||
0x8000ffff,
|
||||
0x0000ffff
|
||||
]
|
||||
});
|
||||
|
||||
const image = await jgd
|
||||
.deflateStrategy(0)
|
||||
.colorType(0)
|
||||
.getBufferAsync(Jimp.MIME_PNG);
|
||||
|
||||
const expected = await jimp.read(imagesDir + '/options.png');
|
||||
const expectedBuffer = await expected
|
||||
.deflateStrategy(0)
|
||||
.colorType(0)
|
||||
.getBufferAsync(Jimp.MIME_PNG);
|
||||
|
||||
image.should.be.deepEqual(expectedBuffer);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user