imagescript 3.16.0 → 3.16.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.
@@ -869,7 +869,8 @@ export function encode(pixels, width, height, quality = 90, { exif, comment, seg
869
869
  { plane: Y, stride: W, h: hmax, v: hmax, blocksX: lumaBlocksX, blocksY: lumaBlocksY, table: 0 },
870
870
  { plane: Cb, stride: CW, h: 1, v: 1, blocksX: chromaBlocksX, blocksY: chromaBlocksY, table: 1 },
871
871
  { plane: Cr, stride: CW, h: 1, v: 1, blocksX: chromaBlocksX, blocksY: chromaBlocksY, table: 1 }
872
- ].slice(0, grey ? 1 : 3);
872
+ ];
873
+ const componentCount = grey ? 1 : 3;
873
874
  const blocksPerMcu = grey ? 1 : hmax * hmax + 2;
874
875
  const count = mcusPerLine * mcusPerColumn * blocksPerMcu;
875
876
  const coefficients = new Int16Array(count * 64);
@@ -878,7 +879,7 @@ export function encode(pixels, width, height, quality = 90, { exif, comment, seg
878
879
  let n = 0;
879
880
  for (let my = 0; my < mcusPerColumn; my++)
880
881
  for (let mx = 0; mx < mcusPerLine; mx++)
881
- for (let c = 0; c < components.length; c++) {
882
+ for (let c = 0; c < componentCount; c++) {
882
883
  const { plane, stride, h: ch, v: cv, blocksX, blocksY, table } = components[c];
883
884
  const reciprocal = divisors[table];
884
885
  for (let v = 0; v < cv; v++) {
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '3.16.0';
1
+ export const VERSION = '3.16.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imagescript",
3
- "version": "3.16.0",
3
+ "version": "3.16.1",
4
4
  "description": "Pure TypeScript image processing that runs everywhere",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",