Skip to content

[codex] fix image rendering edge cases#769

Merged
ryanfowler merged 1 commit into
mainfrom
codex/fix-image-rendering
Jun 15, 2026
Merged

[codex] fix image rendering edge cases#769
ryanfowler merged 1 commit into
mainfrom
codex/fix-image-rendering

Conversation

@ryanfowler

Copy link
Copy Markdown
Owner

Summary

  • Prevent double EXIF orientation when images are decoded through external adapters.
  • Bound external image adapter cleanup so timeout paths do not wait indefinitely on inherited stdout handles.
  • Harden terminal image dimension math against overflow with extreme terminal sizes.
  • Reduce block image ANSI output churn by tracking foreground/background state instead of resetting every cell.

Why

The image renderer had a few correctness and robustness edge cases: external decoders could return already-oriented pixels while fetch applied the original EXIF orientation again, adapter timeout cleanup could block if a descendant kept stdout open, and terminal sizing math used direct u32 multiplication. Block rendering was also emitting avoidable ANSI reset sequences per cell.

Validation

  • cargo fmt --check
  • cargo test --locked --all-features image::
  • cargo test --locked --all-features --test terminal image
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • cargo test --locked --all-features --lib --bins

@ryanfowler ryanfowler marked this pull request as ready for review June 15, 2026 22:24
@ryanfowler ryanfowler enabled auto-merge June 15, 2026 22:25
@ryanfowler ryanfowler merged commit e687650 into main Jun 15, 2026
4 checks passed
@ryanfowler ryanfowler deleted the codex/fix-image-rendering branch June 15, 2026 22:27
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