Repository navigation
Split Jpeg/Png/Tiff/Gif codecs into partial-class files - #25
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add the new partial files to .reviewmark.yaml and update the stale companion design documentation.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR reorganizes JPEG, PNG, TIFF, and GIF codecs into format-specific partial-class files without intended behavior changes.
Changes:
- Split codec implementations into focused per-format files.
- Preserved top-level public API files.
- Updated SysML2 source references.
| File | Summary |
|---|---|
src/DemaConsulting.CanvasNet/Codecs/Tiff/TiffCodec.Utils.cs |
TIFF utility helpers |
src/DemaConsulting.CanvasNet/Codecs/Tiff/TiffCodec.Ifd.cs |
TIFF IFD handling |
src/DemaConsulting.CanvasNet/Codecs/Tiff/TiffCodec.Decode.cs |
TIFF decoding |
src/DemaConsulting.CanvasNet/Codecs/Tiff/TiffCodec.DataSource.cs |
TIFF data sources |
src/DemaConsulting.CanvasNet/Codecs/Tiff/TiffCodec.Compression.cs |
TIFF compression |
src/DemaConsulting.CanvasNet/Codecs/Png/PngCodec.Zlib.cs |
PNG zlib helpers |
src/DemaConsulting.CanvasNet/Codecs/Png/PngCodec.Filtering.cs |
PNG filtering |
src/DemaConsulting.CanvasNet/Codecs/Png/PngCodec.Decode.cs |
PNG decoding |
src/DemaConsulting.CanvasNet/Codecs/Jpeg/JpegCodec.Huffman.cs |
JPEG Huffman logic |
src/DemaConsulting.CanvasNet/Codecs/Jpeg/JpegCodec.Encoder.cs |
JPEG encoding |
src/DemaConsulting.CanvasNet/Codecs/Jpeg/JpegCodec.Decoder.Scan.cs |
JPEG scan decoding |
src/DemaConsulting.CanvasNet/Codecs/Jpeg/JpegCodec.Decoder.cs |
JPEG decoding |
src/DemaConsulting.CanvasNet/Codecs/Jpeg/JpegCodec.Dct.cs |
JPEG DCT logic |
src/DemaConsulting.CanvasNet/Codecs/GifCodec.cs |
GIF API and partial declaration |
src/DemaConsulting.CanvasNet/Codecs/Gif/GifCodec.Lzw.cs |
GIF LZW decoding |
src/DemaConsulting.CanvasNet/Codecs/Gif/GifCodec.Decode.cs |
GIF decoding |
docs/sysml2/model/canvas-net/codecs/tiff-codec.sysml |
TIFF source references |
docs/sysml2/model/canvas-net/codecs/png-codec.sysml |
PNG source references |
docs/sysml2/model/canvas-net/codecs/jpeg-codec.sysml |
JPEG source references |
docs/sysml2/model/canvas-net/codecs/gif-codec.sysml |
GIF source references |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- docs/design/introduction.md: document the new Png/Tiff/Jpeg/Gif subfolders alongside their slim front-door *Codec.cs files in the Codecs folder-layout tree. - docs/design/canvas-net/codecs/tiff-codec.md: correct the stale claim that the zlib helper is 'privately within TiffCodec.cs' - it now lives in Tiff/TiffCodec.Utils.cs. - .reviewmark.yaml: add glob entries for each new partial-class subfolder (Png/Tiff/Jpeg/Gif) to the corresponding codec review-sets, mirroring the Svg/**/*.cs precedent from PR #24.
This was referenced Oct 5, 2026
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
JpegCodec.cs(2,908 lines),PngCodec.cs(2,408),TiffCodec.cs(1,778), andGifCodec.cs(1,428) were each too large for one file. This is a pure mechanical reorganization with zero behavior change: each becomes apartial classspread across coherent files under a new per-format subfolder (Codecs/Jpeg/,Codecs/Png/,Codecs/Tiff/,Codecs/Gif/), split by natural concern (decode/encode/shared-math/compression-helpers). Each top-levelCodecs/XxxCodec.cskeeps just the publicLoad/Save/GetInfoAPI surface, matching this repo'"'"'s one-file-per-codec convention.No method was renamed, no signature changed, no logic altered - only file boundaries and the
class->partial classkeyword. Spot-verified byte-for-byte identical on a representative algorithm (PNG'"'"'sPaethPredictor) plus full test-suite pass.New file layout
JPEG (2,908 -> 6 files):
JpegCodec.cs(563) -Jpeg/JpegCodec.Huffman.cs(216) -.Dct.cs(166) -.Decoder.cs(851) -.Decoder.Scan.cs(699) -.Encoder.cs(450)PNG (2,408 -> 5 files):
PngCodec.cs(619) -Png/PngCodec.Chunks.cs(1013) -.Decode.cs(406) -.Filtering.cs(149) -.Zlib.cs(243)TIFF (1,778 -> 6 files):
TiffCodec.cs(529) -Tiff/TiffCodec.DataSource.cs(139) -.Decode.cs(342) -.Ifd.cs(231) -.Compression.cs(369) -.Utils.cs(194)GIF (1,428 -> 3 files):
GifCodec.cs(537) -Gif/GifCodec.Decode.cs(722) -.Lzw.cs(179)docs/sysml2/model/canvas-net/codecs/{jpeg,png,tiff,gif}-codec.sysmlsourceRefcomments updated to list every new file path.Testing
4305/4305tests passing - identical count tomainbefore this change.lint.ps1clean.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com