@pi-r/jimp 0.10.0 → 0.10.1
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 +3 -3
- package/package.json +3 -3
- package/util.js +1 -1
package/index.js
CHANGED
|
@@ -448,7 +448,7 @@ class JimpHandler {
|
|
|
448
448
|
}
|
|
449
449
|
args.push('-o', (0, util_1.normalizePath)(filename));
|
|
450
450
|
try {
|
|
451
|
-
child_process.execFile(await (0, util_1.importBinary)('cwebp', webp.path), args, { shell: true, signal: this.instance.signal, ...execOptions(settings) }, err => {
|
|
451
|
+
child_process.execFile((0, types_1.sanitizeCmd)(await (0, util_1.importBinary)('cwebp', webp.path), args), { shell: true, signal: this.instance.signal, ...execOptions(settings) }, err => {
|
|
452
452
|
if (err) {
|
|
453
453
|
this.instance.writeFail(["Unable to convert file", path.basename(filename)], err, 2048);
|
|
454
454
|
}
|
|
@@ -856,7 +856,7 @@ class Jimp extends Image {
|
|
|
856
856
|
}
|
|
857
857
|
args.push('-o', (0, util_1.normalizePath)(webp));
|
|
858
858
|
try {
|
|
859
|
-
child_process.execFile(await (0, util_1.importBinary)('gif2webp', webp_path), args, { shell: true, signal: this.signal, ...execOptions(this.settings) }, (err, stdout) => {
|
|
859
|
+
child_process.execFile((0, types_1.sanitizeCmd)(await (0, util_1.importBinary)('gif2webp', webp_path), args), { shell: true, signal: this.signal, ...execOptions(this.settings) }, (err, stdout) => {
|
|
860
860
|
if (!err) {
|
|
861
861
|
this.addLog(types_1.STATUS_TYPE.INFO, stdout);
|
|
862
862
|
finalize(webp);
|
|
@@ -1037,7 +1037,7 @@ class Jimp extends Image {
|
|
|
1037
1037
|
const { path: webp_path } = settings.webp ||= {};
|
|
1038
1038
|
const bmpFile = getTempPath(this, 'bmp');
|
|
1039
1039
|
try {
|
|
1040
|
-
child_process.execFile(await (0, util_1.importBinary)('dwebp', webp_path), [(0, util_1.normalizePath)(localUri), '-bmp', '-o', (0, util_1.normalizePath)(bmpFile)], { shell: true, signal: this.signal, ...execOptions(settings) }, err => {
|
|
1040
|
+
child_process.execFile((0, types_1.sanitizeCmd)(await (0, util_1.importBinary)('dwebp', webp_path), [(0, util_1.normalizePath)(localUri), '-bmp', '-o', (0, util_1.normalizePath)(bmpFile)]), { shell: true, signal: this.signal, ...execOptions(settings) }, err => {
|
|
1041
1041
|
if (!err) {
|
|
1042
1042
|
transformBuffer(bmpFile);
|
|
1043
1043
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/jimp",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Jimp V0 image constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/image": "^0.12.
|
|
24
|
-
"@e-mc/types": "^0.12.
|
|
23
|
+
"@e-mc/image": "^0.12.3",
|
|
24
|
+
"@e-mc/types": "^0.12.3",
|
|
25
25
|
"bmp-js": "^0.1.0",
|
|
26
26
|
"gifwrap": "^0.10.1",
|
|
27
27
|
"jimp": "^0.22.12"
|
package/util.js
CHANGED
|
@@ -88,7 +88,7 @@ async function importBinary(name, pathname) {
|
|
|
88
88
|
if (pathname && fs.existsSync(pathname)) {
|
|
89
89
|
name += Image.PLATFORM_WIN32 ? '.exe' : '';
|
|
90
90
|
const bin = path.join(pathname, name);
|
|
91
|
-
return
|
|
91
|
+
return fs.existsSync(bin) ? bin : path.join(pathname, 'bin', name);
|
|
92
92
|
}
|
|
93
93
|
return types.importESM(name + '-bin', true);
|
|
94
94
|
}
|