Skip to content

feat(mygo): expose cached decoded image dimensions - #279

Merged
tiensonqin merged 1 commit into
mainfrom
host-natural-image-size
Oct 25, 2026
Merged

tiensonqin merged 1 commit into
mainfrom
host-natural-image-size

Conversation

@tiensonqin

Copy link
Copy Markdown
Collaborator

Summary

Expose Backend.NaturalImageSize(id) (width, height float32, ready bool) so desktop adapters can answer natural-size queries for standard image, file-image and avatar nodes without a second decoder or guessed layout dimensions.

The read-only UI-thread query uses current registered images or the current retained state's decoded pixels. URL sources take precedence over registrations; source/decode-limit mismatches, pending work, retired nodes and closed resources return unavailable. Dimensions reflect actual decoded pixels, including max-pixel-size downsampling, not cropping or placeholder sizes. Documents lifecycle and retry semantics in docs/api-migrations.md.

Validated against the pinned MyGo dependency without workspace overrides: gofmt, git diff --check, go test ./..., go test -race ./..., go vet ./..., go build ./... in platform/mygo. No test changes: existing resource lifecycle, source replacement and decode-size contracts cover the underlying state; test-value-gate denied redundant getter tests. No UI-driven testing.

Link to Devin session: https://app.devin.ai/sessions/79843e4449f241f7bef6c8b6b71c5354
Open in Devin Desktop: https://app.devin.ai/desktop/session/79843e4449f241f7bef6c8b6b71c5354?variant=devin
Requested by: @tiensonqin

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@tiensonqin
tiensonqin merged commit fe9cb37 into main Oct 25, 2026
14 of 15 checks passed
@tiensonqin
tiensonqin deleted the host-natural-image-size branch October 25, 2026 20:56
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