Skip to content

fix(web): use intrinsic static image dimensions - #126

Draft
MohamedRed wants to merge 1 commit into
roboflow:mainfrom
MohamedRed:fix/static-image-intrinsic-dimensions
Draft

MohamedRed wants to merge 1 commit into
roboflow:mainfrom
MohamedRed:fix/static-image-intrinsic-dimensions

Conversation

@MohamedRed

Copy link
Copy Markdown

Description

An HTML image styled smaller than its decoded pixels currently reports its layout size as the media size, affecting drawing and annotation coordinates. The advertised VideoFrame input also fails because it exposes display dimensions rather than generic width/height.

Prefer HTML image intrinsic dimensions and VideoFrame display dimensions, validate finite positive sizes, and retain the existing canvas/bitmap handling and caller ownership.

Type of Change

  • Bug fix

Validation

  • Tests added where behavior changed
  • Final branch: all 11 focused adapter tests pass; seven regressions fail on the original implementation.
  • Prior full validation at 1c9ec15: VITEST_MAX_WORKERS=2 npm run verify passed (2,885 tests), as did tarball packaging and all 12 external-consumer checks.
  • Native macOS Chrome validation passed for real image, bitmap, canvas, and VideoFrame inputs, including display ratio/rotation, public renderer annotation alignment, resizing, source replacement, and ownership.

Notes For Reviewers

VideoFrame display dimensions already account for native rotation and aspect ratio. The corrected dimensions can change rendering for consumers relying on image layout size; an explicit canvas/host-drawn size remains available.

Open PR #121 touches the adapter and tarball test with separate clock-reason/license-notice additions; its current hunks do not implement this fix.

AI assistance: Prepared with OpenAI Codex assistance.

This branch has not been deployed

No deployments
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