spine-rigc 0.28.0 → 0.30.0

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.
@@ -46,7 +46,7 @@ import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync,
46
46
  import { basename, join, resolve } from 'node:path';
47
47
 
48
48
  /** Where the editor lives, per platform, from Esoteric's own CLI page. */
49
- const EDITOR_DEFAULTS: Record<string, string> = {
49
+ export const EDITOR_DEFAULTS: Record<string, string> = {
50
50
  darwin: '/Applications/Spine.app/Contents/MacOS/Spine',
51
51
  win32: 'C:\\Program Files\\Spine\\Spine.com',
52
52
  linux: '/opt/Spine/Spine',
package/tools/plate.ts CHANGED
@@ -15,6 +15,7 @@
15
15
  import { deflateSync, inflateSync } from 'node:zlib';
16
16
  import { readFileSync, writeFileSync } from 'node:fs';
17
17
  import { drawText, textWidth } from './font5x7.ts';
18
+ import { assertPng } from '../src/png.ts';
18
19
 
19
20
  export type RGBA = [number, number, number, number];
20
21
 
@@ -421,6 +422,11 @@ export function readPlate(path: string): Plate {
421
422
  // rewording an ENOENT as a decoding problem would mislabel the commonest
422
423
  // failure of all.
423
424
  const buf = readFileSync(path);
425
+ // What the file IS comes first, and from the one reader that says so (issue
426
+ // #732): `decodePng` walks chunks from byte 8 whatever the first eight were,
427
+ // so a WebP page reached it and came back as "unexpected end of file" — an
428
+ // inflate error about a file that was never a PNG.
429
+ assertPng(buf, path);
424
430
  try {
425
431
  return decodePng(buf);
426
432
  } catch (err) {