Surface the psnr field on ImageResult - #11
Merged
Merged
Conversation
The API's optimize and convert responses now carry psnr, the peak signal-to-noise ratio in decibels between the input and the output. The property defaults to null and sits last in the constructor, so existing positional and named-argument construction keeps working. Responses without the field (resize, thumbnail, older API versions) map to null. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds a test asserting the pre-3.1 six-argument constructor still works and defaults psnr to null, so the additive parameter cannot silently become a breaking change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Two independent reviews, one by a Claude agent and one by codex (gpt-5.6-sol, read-only). Both approve with no blocking findings. Codex's one optional suggestion (a test that directly constructs Claude reviewVerdict: clean and safe to ship as v3.1.0. No blocking findings. What I verified
Minor notes
Codex reviewVerdict: Approve. The change is correct, convention-consistent, and appropriate for the additive v3.1.0 release. Critical: None. Major: None. Minor: None. Minor notes
Validation: 52 tests / 151 assertions passed, syntax checks clean, |
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.
SDK side of Art-Commerce-Systems/glimpseimg.com#91 (API PR: Art-Commerce-Systems/glimpseimg.com#98).
What
ImageResultgainspublic ?float $psnr = nullas the last promoted constructor parameter. The default keepsnew ImageResult(...)backward compatible for positional and named-argument callers, which is the only non-breaking option on a readonly class.fromResponse()maps the field with the same null-guard idiom asSizeEstimate::$quality, so an absent or null field never coerces to0.0.Clientchanges: the responsedataarray already flows intofromResponse().Rollout
Merge after the API PR. Works against old and new API alike (the field is just null against an older API). Suggested release: v3.1.0 (additive, minor). glimpse-cli v1.4.0 will require
^3.1.Verification
composer testpasses: 52 tests, 151 assertions.🤖 Generated with Claude Code