Skip to content

Progressively load higher-resolution images when zooming in the session detail view #1373

Description

@mihow

Summary

The session detail view renders captures from a generated "large" (2560px) thumbnail so that detection bounding boxes align with the displayed pixels (see the fix for portrait EXIF-rotated captures). This keeps the initial view fast and correct, but when a user zooms far into a capture, 2560px is noticeably softer than the original file (often 4000px or wider). We should load higher-resolution imagery on demand as the user zooms in.

Proposed behavior

  1. The view starts with the large thumbnail, as it does today.
  2. When the zoom level crosses a threshold (for example, when the effective on-screen resolution exceeds the thumbnail's native resolution), the original source image is fetched and swapped in underneath the existing zoom/pan transform, similar to how map tiles sharpen as you zoom.
  3. The swap should be seamless: keep showing the thumbnail until the full image has loaded, then replace it without resetting the zoom or pan position.

Constraint: EXIF orientation must not regress bounding boxes

The original file can carry an EXIF Orientation tag. Browsers force-apply that rotation to cross-origin images, while detection coordinates are stored in the raw (unrotated) pixel space — this is exactly the bug that moving to thumbnails fixed. Swapping the source image in at high zoom would re-introduce misplaced boxes for those captures.

A simple guard: after the source image loads, compare its reported natural dimensions against the capture's stored width and height. If they are transposed (rotated orientation), skip the swap and stay on the thumbnail. A fuller solution would expose the orientation from the backend and transform the box coordinates to match.

Notes

  • The zoom/pan interaction was added in Add zoom and pan support in session detail view #1339; the thumbnail-based rendering and the "large" size were added in the follow-up fix for portrait captures.
  • Bandwidth is also worth considering: original files can be several megabytes each, so the swap should only happen on sustained zoom, not on every pinch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions