@pi-r/jimp 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +6 -6
- package/util.js +2 -2
package/index.js
CHANGED
|
@@ -270,7 +270,7 @@ function getTempPath(instance, ext) {
|
|
|
270
270
|
function rotateAnim(cmd) {
|
|
271
271
|
const rotate = cmd.rotate;
|
|
272
272
|
if (rotate) {
|
|
273
|
-
rotate.values = [rotate.values.
|
|
273
|
+
rotate.values = [rotate.values.at(-1)];
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
function setBackground(instance, args) {
|
|
@@ -462,7 +462,7 @@ class JimpHandler {
|
|
|
462
462
|
}
|
|
463
463
|
async getBuffer(tempFile, saveAs) {
|
|
464
464
|
const emptyData = () => tempFile ? '' : null;
|
|
465
|
-
const output = getTempPath(this.instance, saveAs && util.MIME_OUTPUT.has('image/' + (saveAs === 'jpg' ? 'jpeg' : saveAs)) ? saveAs : (this.handler.mime || this.instance.outputType).split('/').
|
|
465
|
+
const output = getTempPath(this.instance, saveAs && util.MIME_OUTPUT.has('image/' + (saveAs === 'jpg' ? 'jpeg' : saveAs)) ? saveAs : (this.handler.mime || this.instance.outputType).split('/').at(-1));
|
|
466
466
|
if (!output) {
|
|
467
467
|
return emptyData();
|
|
468
468
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/jimp",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Jimp V1 image constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/anpham6/pi-
|
|
9
|
+
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
10
10
|
"directory": "src/module/jimp"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
],
|
|
16
16
|
"author": "An Pham <anpham6@gmail.com>",
|
|
17
17
|
"license": "MIT",
|
|
18
|
-
"homepage": "https://github.com/anpham6/pi-
|
|
18
|
+
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@e-mc/core": "^0.14.
|
|
21
|
-
"@e-mc/image": "^0.14.
|
|
22
|
-
"@e-mc/types": "^0.14.
|
|
20
|
+
"@e-mc/core": "^0.14.3",
|
|
21
|
+
"@e-mc/image": "^0.14.3",
|
|
22
|
+
"@e-mc/types": "^0.14.3",
|
|
23
23
|
"@jimp/utils": "1.6.0",
|
|
24
24
|
"bmp-js": "^0.1.0",
|
|
25
25
|
"gifwrap": "^0.10.1",
|
package/util.js
CHANGED
|
@@ -89,13 +89,13 @@ function showInputType(value, outputType, finalAs) {
|
|
|
89
89
|
if (finalAs) {
|
|
90
90
|
outputType = 'image/' + finalAs;
|
|
91
91
|
}
|
|
92
|
-
return value && outputType !== value ? value.split('/').
|
|
92
|
+
return value && outputType !== value ? value.split('/').at(-1) + ' -> ' : '';
|
|
93
93
|
}
|
|
94
94
|
function showOutputType(value, outputType, finalAs) {
|
|
95
95
|
if (finalAs) {
|
|
96
96
|
outputType = 'image/' + finalAs;
|
|
97
97
|
}
|
|
98
|
-
return value !== outputType ? ' -> ' + outputType.split('/').
|
|
98
|
+
return value !== outputType ? ' -> ' + outputType.split('/').at(-1) : '';
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
exports.MIME_INPUT = MIME_INPUT;
|