Skip to content

Add focal point cropping to Image - #213

Merged
TorstenDittmann merged 2 commits into
mainfrom
feat/image-focal-point-crop
Sep 7, 2026
Merged

Add focal point cropping to Image#213
TorstenDittmann merged 2 commits into
mainfrom
feat/image-focal-point-crop

Conversation

@TorstenDittmann

Copy link
Copy Markdown
Contributor

Summary

  • allow Image::crop() to accept normalized x and y focal coordinates
  • keep the focal point centered where possible and clamp the crop to image bounds
  • preserve existing gravity behavior when coordinates are omitted
  • reject incomplete, out-of-range, and non-finite coordinates

This supersedes utopia-php/image#48, which was automatically closed because that repository is a read-only mirror.

Tests

  • vendor/bin/phpunit --testsuite unit --filter CropFocal (PHP 8.3 + Imagick): 5 tests, 15 assertions
  • PHPStan level max: no errors
  • PHP syntax and diff checks passed

Coverage includes non-anchor placement, incomplete/out-of-range/non-finite validation, and animated frame content, dimensions, and aggregate delay.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T16:07:34.379372Z 7ee2957 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@TorstenDittmann
TorstenDittmann merged commit 0892539 into main Sep 7, 2026
5 checks passed
@TorstenDittmann
TorstenDittmann deleted the feat/image-focal-point-crop branch September 7, 2026 10:00
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.

2 participants