Repository navigation
Art tiles keep their picture's aspect: cover-crop by UV instead of stretching - #234
Conversation
…retching Every image is fetched as a `minSize=1` photo transcode, which COVERS the requested box rather than fitting it, so a texture carries its SOURCE's aspect. The art-tile draw sampled the whole texture into the tile's rect regardless, so a 2:3 headshot asked for at 300x300 (decoded 300x450) was squashed to two-thirds of its height in the cast row's circle, and the same held for every other tile whose art was not its box's shape. The shared image draw now takes a UV window: `Rect::cover_uv` computes the aspect-preserving cover crop (sides evenly for a wider source; a taller one by `Crop` - even, or `Headshot`, which takes a fifth of the overflow off the top so faces stay in frame), and gfx composes it under the card composite's shadow-padding remap. `widgets::card` - the one draw every art tile goes through - resolves the texture WITH its decoded size and crops by `art_uv`; the profile chip avatar and the player info panel's still do the same. The id-only `resolve_tex`/`resolve_tex_on` are removed, so no picture can be resolved without the size it needs to be drawn undistorted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85df74b629
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// **The size is not optional, which is why this is the only resolver.** Every image is fetched as | ||
| /// a `minSize=1` transcode, which COVERS the requested box rather than fitting it, so a texture's | ||
| /// aspect is the SOURCE's and not the box's; a picture drawn into its frame without it is | ||
| /// stretched. [`card`] turns it into a crop ([`art_uv`]), a backdrop into an overflow |
There was a problem hiding this comment.
Reconcile the documented transcode contract
This new invariant says minSize=1 preserves the source aspect, but docs/pms-api.md:720-733 still instructs callers to add upscale=1 and says the verified response is cropped to exactly the requested dimensions. That contract would make tw/th equal the tile aspect and turn this crop into an identity operation, so a future caller cannot tell whether omitting upscale is intentional or safely follow the API guide without defeating this fix. Update the image API section to document the request actually used here and its observed output dimensions.
AGENTS.md reference: AGENTS.md:L97-L99
Useful? React with 👍 / 👎.
…'s cover shape No code sends upscale=1, and minSize=1 fills the box keeping the source's aspect rather than cropping to exactly w x h - which the draw-time cover crop depends on. Marked unverified against a real PMS; the size table now lists the boxes the app actually requests and how each consumer maps a mismatched aspect. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#234, #235, #236, #237 and #239 passed on the television on a debug build of 3a30a01, each with the log lines behind it; #238 stays pending (it needs real playback), and #237's new focus-on-Sign-out finding is pending its own fix. Records the second pass's harness results and marks the 0.6.6 -> 0.7.0 in-place upgrade as blocked, with what unblocks it and what was observed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The note gains the image-subtitle fix, the trailer stop/reporting/redirect behaviour, the art-crop, library-seat and profiles read-out fixes, and a line for nightly users about BACK from the player. The audit records the seven changes as host-verified and pending the device pass, the bundled FFmpeg's new libz.so.1 dependency with its firmware evidence, and the https HLS cross-origin redirect gap as a known follow-up. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#234, #235, #236, #237 and #239 passed on the television on a debug build of 3a30a01, each with the log lines behind it; #238 stays pending (it needs real playback), and #237's new focus-on-Sign-out finding is pending its own fix. Records the second pass's harness results and marks the 0.6.6 -> 0.7.0 in-place upgrade as blocked, with what unblocks it and what was observed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…brary firmware gate (#241) * docs: correct two claims #235 and #239 left stale ci/build-ffmpeg.sh: the firmware database fwsym holds spans platform releases 1.2.0 to 11.2.0, not webOS 3 to 10; libz.so.1 is in every image. docs/trailer-ux-plan.md: the deferred just_finished proposal names the preview machine's current transitions, Machine::eos and Machine::stopped, as docs/TODOS.md already does. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 0.7.0 release note and audit: cover #234-#240 The note gains the image-subtitle fix, the trailer stop/reporting/redirect behaviour, the art-crop, library-seat and profiles read-out fixes, and a line for nightly users about BACK from the player. The audit records the seven changes as host-verified and pending the device pass, the bundled FFmpeg's new libz.so.1 dependency with its firmware evidence, and the https HLS cross-origin redirect gap as a known follow-up. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: the audit lint refuses an unfilled placeholder in the authored half Nothing substitutes into a release audit's authored half; gen-release-audit only replaces the generated block, so a __PLACEHOLDER__ left there publishes literally. Watched red on the v0.7.0 audit's __GATES__ row before it was filled; every existing audit and the template pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> * v0.7.0 audit: record the gates run on the release-prep tree Co-Authored-By: Claude Opus 5.5 <[email protected]> * v0.7.0 audit: fold in the second device pass over #234-#240 #234, #235, #236, #237 and #239 passed on the television on a debug build of 3a30a01, each with the log lines behind it; #238 stays pending (it needs real playback), and #237's new focus-on-Sign-out finding is pending its own fix. Records the second pass's harness results and marks the 0.6.6 -> 0.7.0 in-place upgrade as blocked, with what unblocks it and what was observed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 0.7.0 release note and audit: #242 fixes the device pass's Sign-out focus finding The audit lists #242 among the changes landed after the device pass, host-verified and pending the device, and marks #237's focus-on-Sign-out finding fixed by it. The note's smaller fixes gain the menu-focus line. Co-Authored-By: Claude Opus 5.5 <[email protected]> * v0.7.0 audit: the gate row names the tree rebased onto #242 Co-Authored-By: Claude Opus 5.5 <[email protected]> * 0.7.0 note and audit: scope the trailer and library promises, record the pass's account writes Review findings on #241: - A trailer started with Play Trailer is an ordinary playback (request_play, preview: false) and reports a timeline; only the background preview, full-screen mode included, never reports. - The library DOWN fix holds only when the reader has not moved before the shelves load. - The device-pass summary counts #236 as passed only for shelves-first. - The pass wrote to the Guest profile: the explicit PGS pick's PUT /library/parts selection, and the harness's unscrobble, progress seeds and playback timelines. - The gate row states that every commit after b99e79f is note/audit only and which checks were re-run on the head. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fwcompat: grade the bundled FFmpeg libraries, and put their DT_NEEDED in the audit #235 gave libavformat-plx a DT_NEEDED on libz.so.1, and nothing graded it: the libraries are dlopen'd, webosbrew-ipk-verify grades only the app and service executables, and fwcompat on a bundled library reported every firmware FAIL for the sibling libav*-plx names no firmware carries. tools/fwcompat.py --shipped DIR takes DT_NEEDED names that are files in DIR off the firmware's list and counts what they export as resolved. Watched: bare, libavformat-plx FAILs everywhere on its siblings; with --shipped pkg all three pass from 4.4.2 to 11.2.0; against a copy of the 4.4.2 database with libz removed it FAILs on libz.so.1 (4 symbols) and exits 1. CI's firmware load matrix and the build's fwcompat gate now run it over each bundled library; the build appends the matrix to pkg/ipk-verify.md, which gen-release-audit.py embeds, and gen-release-audit.py lists each bundled library's DT_NEEDED. Review finding on #241: the zlib verdict is now read from the published package instead of typed into the audit. Co-Authored-By: Claude Opus 5.5 <[email protected]> * v0.7.0 audit: the zlib entry defers to the generated half; the gate row names the tooling commits Co-Authored-By: Claude Opus 5.5 <[email protected]> * fwcompat review: row() takes its cells, and --shipped says what it trusts Co-Authored-By: Claude Opus 5.5 <[email protected]> * build-package: the bundled-library matrix goes into ipk-verify.md unfenced gen-release-audit.py already wraps that whole file in one code fence; a nested fence closed it. Only the step summary fences the aligned columns now. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Root cause
Every image the app fetches is a
/photo/:/transcode?...&minSize=1. That parameter makes the server cover the requested box, not fit it, so a texture keeps the aspect of its source (rust-modules/src/img.rs, decode-budget note). The art-tile draw ignored this. Onmain,ui/widgets.rs:631-633(Art::Person) resolved only the texture id (resolve_tex_on) and calledp.tex_carded(t, r, ...). The card composite (gfx::draw_tex_impl→vs_img.vert) then drew UV 0..1 across the tile rect. So a 2:3 headshot requested at 300×300 decodes at 300×450, and it was squashed to two-thirds of its height in the 190 px cast circle. The other threeArtarms, the profile-chip avatar and the player info panel's still all had the same problem.Fix: one shared, aspect-preserving mapping
ui::Rect::cover_uv(tw, th, Crop) -> [f32; 4]is a pure function. It returns the UV window of atw×thsource that covers the rect with its aspect preserved:Crop.Centresplits evenly.Headshottakes one fifth of the overflow off the top, so the face stays in frame.UV_FULL, the whole texture.gfx:draw_tex_impltakes acrop, anduv_composefolds it under the card composite's existing shadow-padding remap, so the shader and the draw count stay the same.draw_tex_carded/draw_tex_strokedtake the crop;draw_tex_uvis new.Painter::tex_carded/tex_strokedtakeuv,Painter::tex_uvis new, and the backdrop-discovery record now includes the UV.widgets::cardis the single draw that every art tile goes through. It now resolves the texture together with its decoded size and draws withart_uv(&art, tw, th, r):Art::Person→Headshot, every other variant →Centre.resolve_tex/resolve_tex_onare removed. The only way left to resolve a picture also returns the size needed to draw it without distortion.Why cover and not fit (contain): the owner asked for "aspect fit", meaning never distort. For a circle or a rounded card, a contained picture leaves empty bands that look like a broken image. Cover-crop is the mapping that never distorts and still fills the shape. No consumer in this code is a case where true fit is clearly better. The one fit-shaped surface, the hero clearLogo, already uses contain math (
hero_logo::fit) and sizes its rect to the logo's own aspect, so it is not affected.Consumers
Migrated (all go through
widgets::card→art_uv):screens/detail/cast.rs,Art::Person, Headshot)screens/person.rs,Art::Person, Headshot)screens/search/render.rs,Art::Person, Headshot)screens/profiles.rs,Art::Thumb, Centre)Art::Poster). A poster is already at its tile's aspect, so this is the identity and the drawing is unchanged.Art::Still). A 16:9 still in a 16:9 tile is unchanged. The poster fallback instill_keyis now cropped instead of squashed.Art::Thumb)Migrated directly:
widgets.rs,tex_stroked, Centre, the same framing as the picker)ui/info_panel.rs,tex_uv)Checked and not affected:
hero_ground: these already useRect::cover, which overflows a full-bleed quad at radius 0.UV_FULL.Tests, RED then GREEN
New tests:
ui/mod.rs:cover_uv_crops_a_portrait_vertically_riding_high_for_a_headshot,cover_uv_crops_a_landscape_horizontally_and_centred,cover_uv_is_the_identity_at_matching_aspect_and_for_an_undecoded_sourcegfx.rs:a_crop_composes_under_the_padding_and_the_full_window_is_its_identityui/widgets_art_crop_tests.rs(the consumer seam, usingRowStyle::CAST):a_portrait_headshot_on_the_cast_row_is_cropped_not_squashed, plus the crop-per-variant test and the identity/fallback testFor RED, the mapping was stubbed back to the old whole-texture behaviour:
GREEN:
Simulator captures
Taken in the host simulator against the synthetic
tests/mock_pms.py. A local-only, uncommitted driver served people photos as synthetic 2:3 portraits: a pale disc high on the frame over a dark band, cover-scaled the way PMS does it. No real account and no real photos. For the "before" capture,cover_uvwas stubbed to the old whole-texture behaviour.Gates (on the committed tree, 85df74b)
make checklib stage:test result: ok. 4359 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 54.35smake checkhostsim stage:test result: FAILED. 4410 passed; 2 failed; 1 ignored. Both failures are EAGAIN/WouldBlock(os error 35) in loopback-socket fixtures:plex::library::tests::show_preferences_fail_fast_without_retrying_errorsandapp::run::lifecycle_regression_tests::did_background_prevents_due_up_next_from_launching_while_suspended. Neither is in code this change touches, and both pass when re-run on their own. Across three full runs, the other failures were acurlioteardown timing test and the sameplex::libraryfixture, each hit only under host load. Somake checkdid not exit 0 on this machine.CARGO_INCREMENTAL=0 cargo +nightly check --manifest-path rust-modules/Cargo.toml --lib --no-default-features:Finished, cleanmake(ARM): exit 0git status --short: empty before and afterReview
An independent adversarial review of the branch diff: verdict approve, no material findings.
Not yet verified
TV verification is pending: LG rasterization of the cropped circles, and the on-device look of real non-square headshots.
🤖 Generated with Claude Code