Distinguish truncated vs unsupported Createc .dat load failures#9
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
ThumbnailLoaderfailure (A260523.012854.dat: zlib decompression failed after DATA marker) on a network drive raised one ambiguous message for two different problems.zlib.decompressalready tolerates trailing bytes after a complete stream (verified), so the fall-through means noDATAmarker yielded an inflatable stream. Now we report which way it failed:0x78after anyDATAmarker → 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