@ffflorian/electron-icon-generator 1.6.2 → 1.6.3

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -6
  2. package/package.json +5 -4
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import path from 'node:path';
3
3
  import fs from 'fs-extra';
4
- import Jimp from 'jimp';
4
+ import { Jimp } from 'jimp';
5
5
  import icongen from 'icon-gen';
6
6
  // eslint-disable-next-line no-magic-numbers
7
7
  const pngSizes = [16, 24, 32, 48, 64, 128, 256, 512, 1024];
@@ -18,15 +18,16 @@ export class IconGenerator {
18
18
  await this.createPNGs(0);
19
19
  }
20
20
  async createPNG(size) {
21
- const fileName = `${size.toString()}.png`;
21
+ const fileName = size.toString();
22
22
  await fs.ensureDir(this.options.output);
23
23
  await fs.ensureDir(this.iconsDir);
24
24
  await fs.ensureDir(this.PNGoutputDir);
25
25
  const image = await Jimp.read(this.options.input);
26
- const resizeFile = path.join(this.PNGoutputDir, fileName);
27
- await new Promise((resolve, reject) => image.resize(size, size, (error, result) => (error ? reject(error) : resolve(result))));
28
- await image.writeAsync(resizeFile);
29
- return `Created "${resizeFile}"`;
26
+ const resizeFilePath = path.join(this.PNGoutputDir, fileName);
27
+ // eslint-disable-next-line id-length
28
+ image.resize({ h: size, w: size });
29
+ await image.write(`${resizeFilePath}.png`);
30
+ return `Created "${resizeFilePath}.png"`;
30
31
  }
31
32
  async createPNGs(position) {
32
33
  const info = await this.createPNG(pngSizes[position]);
package/package.json CHANGED
@@ -5,13 +5,14 @@
5
5
  "commander": "12.1.0",
6
6
  "fs-extra": "11.2.0",
7
7
  "icon-gen": "5.0.0",
8
- "jimp": "0.22.12"
8
+ "jimp": "1.6.0"
9
9
  },
10
10
  "description": "An icon generator to generate all the icon files needed for electron packaging",
11
11
  "devDependencies": {
12
12
  "@types/fs-extra": "11.0.4",
13
+ "@types/pngjs": "6.0.5",
13
14
  "rimraf": "6.0.1",
14
- "typescript": "5.5.4"
15
+ "typescript": "5.6.2"
15
16
  },
16
17
  "engines": {
17
18
  "node": ">= 18.0"
@@ -39,6 +40,6 @@
39
40
  "test": "exit 0"
40
41
  },
41
42
  "type": "module",
42
- "version": "1.6.2",
43
- "gitHead": "61eb972d144debefdd584621ee7316d1961fd8e4"
43
+ "version": "1.6.3",
44
+ "gitHead": "84ac5ce735ca92b43fb263515e72173c5702e4d6"
44
45
  }