From 91842d2e30b9be667cdc24c50fe85f8107ee9b78 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sun, 5 Jul 2026 15:14:24 +0900 Subject: [PATCH] Validate unit sprite PNG color mode --- scripts/verify-unit-sprite-asset-data.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/verify-unit-sprite-asset-data.mjs b/scripts/verify-unit-sprite-asset-data.mjs index bbf09d2..47ec609 100644 --- a/scripts/verify-unit-sprite-asset-data.mjs +++ b/scripts/verify-unit-sprite-asset-data.mjs @@ -208,6 +208,9 @@ function validatePngDimensions(errors, key, path, expected) { if (dimensions.width !== expected.width || dimensions.height !== expected.height) { errors.push(`${key}: expected ${expected.width}x${expected.height}, got ${dimensions.width}x${dimensions.height}`); } + if (dimensions.bitDepth !== 8 || dimensions.colorType !== 6) { + errors.push(`${key}: expected 8-bit RGBA PNG color type 6, got bitDepth=${dimensions.bitDepth} colorType=${dimensions.colorType}`); + } } function readPngDimensions(path) { @@ -224,6 +227,8 @@ function readPngDimensions(path) { return { width: bytes.readUInt32BE(16), - height: bytes.readUInt32BE(20) + height: bytes.readUInt32BE(20), + bitDepth: bytes[24], + colorType: bytes[25] }; }