Skip to content

Distinguish truncated vs unsupported Createc .dat load failures#9

Merged
jacobson30-bot merged 1 commit into
mainfrom
improve-createc-dat-load-errors
Jun 5, 2026
Merged

Distinguish truncated vs unsupported Createc .dat load failures#9
jacobson30-bot merged 1 commit into
mainfrom
improve-createc-dat-load-errors

Conversation

@jacobson30-bot
Copy link
Copy Markdown
Contributor

A ThumbnailLoader failure (A260523.012854.dat: zlib decompression failed after DATA marker) on a network drive raised one ambiguous message for two different problems.

zlib.decompress already tolerates trailing bytes after a complete stream (verified), so the fall-through means no DATA marker yielded an inflatable stream. Now we report which way it failed:

  • zlib header present but won't inflate → corruption/truncation, with the zlib error + file size — the signature of a half-saved scan or an interrupted network-drive copy.
  • no 0x78 after any DATA marker → unsupported variant, naming the leading format token (e.g. [Paramco32]).

Successful decodes are unchanged. Adds tests for both messages and a guard that trailing bytes after a complete stream still decode.

Note: this is diagnostics only — it does not yet load the failing file. Whether that file needs a code fix (an uncompressed/other variant) or is simply truncated will be determined from a small byte-signature diagnostic on the actual file.

🤖 Generated with Claude Code

The decoder raised one ambiguous message — "zlib decompression failed after
DATA marker" — for two very different situations, so a ThumbnailLoader failure
couldn't tell whether the file was incompletely written/copied (re-copy it) or
in a Createc layout the reader doesn't support (a code gap).

zlib.decompress already tolerates trailing bytes after a complete stream, so
reaching the fall-through means no DATA marker yielded an inflatable stream.
Track which way it failed:

- a zlib header (0x78) was present but the stream would not inflate → report
  corruption/truncation (with the zlib error + file size), the signature of a
  half-saved scan or an interrupted network-drive copy;
- no 0x78 followed any DATA marker → report an unsupported variant and name the
  leading format token (e.g. [Paramco32]).

Successful decodes are unchanged. Adds tests for both messages plus a guard
that trailing bytes after a complete stream still decode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jacobson30-bot jacobson30-bot merged commit f447282 into main Jun 5, 2026
3 checks passed
@jacobson30-bot jacobson30-bot deleted the improve-createc-dat-load-errors branch June 5, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant