mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4005] [MERGED] Read zTXt character-card chunks so Character Tavern imports work #6198
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4005
Author: @SpicyMarinara
Created: 7/23/2026
Status: ✅ Merged
Merged: 7/23/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/4002-chartavern-ztxt📝 Commits (2)
bf77babRead zTXt character-card chunks from Character Tavern PNGsd02f87eBound zTXt card decompression📊 Changes
6 files changed (+228 additions, -15 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/client/src/lib/png-parser.ts(+75 -9)📝
packages/server/src/routes/characters.routes.ts(+4 -1)📝
packages/server/src/routes/import.routes.ts(+36 -3)📝
packages/server/src/services/import/st-bulk.importer.ts(+25 -2)📝
scripts/regressions/open-issues.regression.ts(+87 -0)📄 Description
Linked issue
Fixes #4002
Why this change
Every card imported from Character Tavern through the Card Browser failed with "No character data found in PNG — this doesn't appear to be a SillyTavern character card". Reproduced against their live CDN: Character Tavern now embeds the
chara/ccv3card JSON in zTXt (zlib-compressed) PNG chunks. Marinara's card parsers only readtEXtandiTXt, so the PNG parsed fine but no card data was ever found.What changed
All four chunk-reading paths now handle zTXt (compression method 0 / zlib), preferring
ccv3overcharaexactly as before:png-parser.ts) — inflates viaDecompressionStream("deflate")(the Compression Streams zlib format; supported by all browsers Marinara targets). Its data-URL step now builds from the bytes already in memory instead ofFileReader, which also lets the parser run under Node-based regressions.import.routes.ts) and SillyTavern bulk import (st-bulk.importer.ts) — inflate vianode:zlib.characters.routes.ts) — recognizes zTXt keywords, so re-exporting a Character Tavern character strips its stale compressed card data instead of shipping outdated JSON alongside the freshtEXtchunk.Regression: the open-issues lane builds a synthetic zTXt card PNG and asserts client extraction, server extraction, and export stripping. Both parsers were additionally verified against a real downloaded Character Tavern card (extracted
chara_card_v3with correct name from both).Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm checkand the open-issues regression lane were run by the preparing agent and passed; real-card extraction was verified programmatically. The browser UI flow needs the human check above. Checkboxes left unchecked per repository policy.Docs and release impact
CHANGELOG.md updated; no version bump.
UI evidence
No UI changes — the existing import flow simply succeeds where it previously errored.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.