cortico-world-ellen-voice 0.2.0 → 0.2.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.
- package/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/src/png.ts +3 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortico-world-ellen-voice",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ellen Joe voice world for Coopanion: speak through a local GPT-SoVITS service, deliver voice bars to QQ, and install a figure pack from your own PNG",
|
|
6
6
|
"author": "deepseek study",
|
package/src/png.ts
CHANGED
|
@@ -83,7 +83,7 @@ export function decodePng(input: Uint8Array): RgbaImage {
|
|
|
83
83
|
if (interlace !== 0) throw new Error('不支持隔行 PNG(Adam7),请用普通模式重新导出');
|
|
84
84
|
if (bitDepth !== 8 && bitDepth !== 16) throw new Error(`不支持的位深 ${bitDepth}`);
|
|
85
85
|
|
|
86
|
-
const channels = colorType === 6 ? 4 : colorType === 2 ? 3 : colorType === 0 ? 1 : colorType === 3 ? 1 : 0;
|
|
86
|
+
const channels = colorType === 6 ? 4 : colorType === 2 ? 3 : colorType === 4 ? 2 : colorType === 0 ? 1 : colorType === 3 ? 1 : 0;
|
|
87
87
|
if (!channels) throw new Error(`不支持的颜色类型 ${colorType}`);
|
|
88
88
|
|
|
89
89
|
const bytesPerSample = bitDepth / 8;
|
|
@@ -125,6 +125,8 @@ export function decodePng(input: Uint8Array): RgbaImage {
|
|
|
125
125
|
r = line[src]; g = line[src + bytesPerSample]; b = line[src + bytesPerSample * 2];
|
|
126
126
|
} else if (colorType === 0) {
|
|
127
127
|
r = line[src]; g = r; b = r;
|
|
128
|
+
} else if (colorType === 4) {
|
|
129
|
+
r = line[src]; g = r; b = r; alpha = line[src + bytesPerSample];
|
|
128
130
|
} else if (colorType === 3 && palette) {
|
|
129
131
|
const index = line[src];
|
|
130
132
|
r = palette[index * 3] ?? 0;
|