Skip to content

Support raster inputs and JPG output in image-processing#318

Merged
graysurf merged 1 commit intomainfrom
feat/image-processing-multi-format-convert
Apr 1, 2026
Merged

Support raster inputs and JPG output in image-processing#318
graysurf merged 1 commit intomainfrom
feat/image-processing-multi-format-convert

Conversation

@graysurf
Copy link
Copy Markdown
Collaborator

@graysurf graysurf commented Apr 1, 2026

Support raster inputs and JPG output in image-processing

Summary

This PR expands image-processing convert from an SVG-only flow into a general conversion path that accepts svg, png, jpg, jpeg, and webp inputs and emits png, webp, or jpg outputs with the same JSON/report contract style already used by the CLI. It also hardens codex-cli command-shape tests so workspace CI is not affected by a leaked CODEX_CLI_EPHEMERAL_ENABLED environment variable.

Changes

  • Replace the old convert --from-svg contract with convert --in <path> and validate a single input path plus --to png|webp|jpg.
  • Add a Rust-backed raster conversion path with format detection, resize handling, JPEG encode support, and white-background alpha flattening for JPG output.
  • Extend image-processing JSON/report metadata to include source input path and input format for both convert and svg-validate flows.
  • Add regression coverage for SVG and raster inputs across png, webp, and jpg outputs, plus explicit jpg/webp input cases and contract edge cases.
  • Update workspace docs and dependency notes so README/runbook text matches the new image-processing surface.
  • Isolate codex-cli exec/template/runtime tests from CODEX_CLI_EPHEMERAL_ENABLED leakage so required checks pass consistently in CI.

Testing

  • ./.agents/skills/nils-cli-verify-required-checks/scripts/nils-cli-verify-required-checks.sh (pass)
  • cargo llvm-cov nextest --profile ci --workspace --lcov --output-path target/coverage/lcov.info --fail-under-lines 85 (pass)
  • scripts/ci/coverage-summary.sh target/coverage/lcov.info (86.49% total line coverage)

Risk / Notes

  • image-processing convert --from-svg callers must migrate to convert --in; README and runbook examples are updated in this PR.
  • --to jpg now flattens transparent pixels onto white by design, and the summary metadata reports background: white for that mode.
  • The codex-cli test changes are harness-only; they do not change runtime behavior, only remove external env sensitivity.

- Accept svg, png, jpg, jpeg, and webp inputs through convert --in.
- Add rust-backed raster decode and encode paths for png, webp, and jpg outputs.
- Flatten alpha onto white for jpg output and report source input metadata.
- Expand image-processing tests and isolate codex-cli exec tests from ephemeral env leakage.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Coverage

Total line coverage: 86.46% (60163/69586 lines hit).

@graysurf graysurf marked this pull request as ready for review April 1, 2026 14:17
@graysurf graysurf merged commit 497032d into main Apr 1, 2026
11 checks passed
@graysurf graysurf deleted the feat/image-processing-multi-format-convert branch April 1, 2026 14:17
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