Repository navigation
Decode RunLength images, and scope the remaining image codecs - #20
Merged
Merged
Conversation
RunLengthDecode joins Flate, LZW and the two ASCII filters: PdfFilters.RunLength decodes the literal and repeat runs (a truncated stream yields what it stated), PdfImageFilters dispatches it, and an image that declares it now yields samples and Gray8/Rgb24/Cmyk32 pixels instead of ImageFilterUnsupported. ADR-005 accepts the remaining four filters - CCITTFaxDecode, DCTDecode, JPXDecode, JBIG2Decode - in that order, hand-written with no package reference, each with the independent decoder its acceptance needs. The status table records RunLength as done and the rest as planned. The scoped Stryker run over PdfFilters.RunLength.cs is 96.00% (22 killed, 1 survivor, 31 mutants); the survivor is the < that the end-of-data check above it shadows. Two statements were removed because a survivor said so: the Math.Max capacity hint and the count <= 0 guard. The font-fixture test now writes a unique temp file: the mutation harness runs the suite once per project in parallel, and a fixed name let one copy read a file another was still writing.
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.
Summary
First slice of 4a-volledig (the image filters the reader passes through), plus the ADR that scopes the rest.
RunLengthDecode
Pdf/PdfFilters.RunLength.cs— literal runs (control + 1bytes) and repeat runs (257 - control), the end-of-data byte optional, and a truncated stream decoded as far as it goes.PdfImageFiltersdispatches it, so an image that declares it now reportsIsDecodabletrue and yields samples;ImagePixelsexposes them asGray8,Rgb24orCmyk32.FilterChainsfixture now actually run-length-encodes its samples (it was storing them raw), andDecodes_a_run_length_imagereplaces the theory that pinned the old “cannot decode” behaviour.ADR-005 — the remaining four
docs/adr/0005-image-filter-decoders.mdacceptsCCITTFaxDecode,DCTDecode,JPXDecodeandJBIG2Decodein that order, hand-written with no package reference (ADR-001), each with the independent decoder its acceptance needs:CCITTFaxDecodeDCTDecodeJPXDecodeopj_decompressJBIG2Decodejbig2decA test the harness exposed
Writes_the_font_fixture_the_external_validator_readswrote a fixed temp path. Stryker runs the suite once per project in parallel, so four copies raced on the same file and the initial run failed. The name is now unique (Guid), which is the correct behaviour whether or not the harness is watching.Evidence
dotnet build -c Release→ 0 warnings, 0 errors;dotnet test→ 1234 passed, 0 failed onnet10.0andnet11.0.PdfFilters.RunLength.cs→ 96.00% (22 killed, 1 survivor, 31 mutants). The survivor iscontrol < 128→<=, shadowed by the== 128check above it; two other survivors were redundant statements and were removed. Recorded indocs/mutation-testing.md.Not in this PR
CCITTFaxDecode,DCTDecode,JPXDecodeandJBIG2Decodeare the next slices, in the order ADR-005 records; each is a decoder of its own and lands with its own evidence and mutation record.