@thi.ng/pixel-io-netpbm 2.1.129 → 2.1.130

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-04-23T07:02:18Z
3
+ - **Last updated**: 2024-05-08T18:24:32Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/pixel-io-netpbm",
3
- "version": "2.1.129",
3
+ "version": "2.1.130",
4
4
  "description": "Multi-format NetPBM reader & writer support for @thi.ng/pixel",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -36,15 +36,15 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/api": "^8.11.1",
40
- "@thi.ng/errors": "^2.5.6",
41
- "@thi.ng/pixel": "^6.1.31"
39
+ "@thi.ng/api": "^8.11.2",
40
+ "@thi.ng/errors": "^2.5.7",
41
+ "@thi.ng/pixel": "^6.1.32"
42
42
  },
43
43
  "devDependencies": {
44
- "@microsoft/api-extractor": "^7.43.0",
45
- "esbuild": "^0.20.2",
46
- "typedoc": "^0.25.12",
47
- "typescript": "^5.4.3"
44
+ "@microsoft/api-extractor": "^7.43.2",
45
+ "esbuild": "^0.21.1",
46
+ "typedoc": "^0.25.13",
47
+ "typescript": "^5.4.5"
48
48
  },
49
49
  "keywords": [
50
50
  "1bit",
@@ -87,5 +87,5 @@
87
87
  "parent": "@thi.ng/pixel",
88
88
  "year": 2021
89
89
  },
90
- "gitHead": "aed3421c21044c005fbcb7cc37965ccf85a870d2\n"
90
+ "gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
91
91
  }
package/read.js CHANGED
@@ -74,8 +74,7 @@ const readPBM = (src, i, width, height) => {
74
74
  for (let y = 0, j = 0; y < height; y++) {
75
75
  for (let x = 0; x < width; x++, j++) {
76
76
  data[j] = src[i] & 1 << (~x & 7) ? 0 : 255;
77
- if ((x & 7) === 7 || x === w1)
78
- i++;
77
+ if ((x & 7) === 7 || x === w1) i++;
79
78
  }
80
79
  }
81
80
  return buf;
package/write.js CHANGED
@@ -4,12 +4,10 @@ const initHeader = (magic, limits, size, buf, comments) => {
4
4
  const { width, height } = buf;
5
5
  let header = magic + "\n";
6
6
  const comm = formatComments(comments);
7
- if (comm.length)
8
- header += comm + "\n";
7
+ if (comm.length) header += comm + "\n";
9
8
  header += `${width} ${height}
10
9
  `;
11
- if (limits > 0)
12
- header += limits + "\n";
10
+ if (limits > 0) header += limits + "\n";
13
11
  const dest = new Uint8Array(size + header.length);
14
12
  dest.set([...header].map((x) => x.charCodeAt(0)));
15
13
  return { dest, start: header.length, abgr: buf.format.toABGR };
@@ -53,8 +51,7 @@ const asPGM = (buf, comments) => {
53
51
  return dest;
54
52
  };
55
53
  const asPGM16 = (buf, comments) => {
56
- if (buf.format !== GRAY16)
57
- buf = buf.as(GRAY16);
54
+ if (buf.format !== GRAY16) buf = buf.as(GRAY16);
58
55
  const { data, width, height } = buf;
59
56
  const { dest, start } = initHeader(
60
57
  "P5",