Skip to content

fix: fit rotated preview images into the stage - #4405

Merged
kulmann merged 3 commits into
mainfrom
fix/preview-rotate-fit
Nov 10, 2026
Merged

kulmann merged 3 commits into
mainfrom
fix/preview-rotate-fit

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Description

  • Rotation: after a quarter turn the preview now fits the image into the stage again, like the image editor in Immich does. Before, about a quarter of any image that filled the stage's short side was cut off (landscape SVGs and photos on desktop, portrait ones on phones).
  • Zoom and pan stay relative to the fitted size, the fit follows window size changes, and a zoomed or rotated image no longer makes the stage scroll.

Before

before-main.mp4

After

after-fix.mp4

Related Issue

How Has This Been Tested?

  • test environment: browser tests (Playwright) against a local OpenCloud
  • test case 1: browser: SVGs (with size and viewBox only), large landscape and portrait PNGs and a motion photo (still and video) fit at ±90° on desktop and Pixel 7, unchanged at 0/180
  • test case 2: browser: zoom buttons, Ctrl+wheel, drag and reset on rotated images, rotating while zoomed, window resize, next/previous
  • test case 3: browser: swipe and pinch on Pixel 7, video and audio previews unchanged

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@kulmann
kulmann merged commit 2cb5bb3 into main Nov 10, 2026
28 checks passed
@kulmann
kulmann deleted the fix/preview-rotate-fit branch November 10, 2026 11:25
@openclouders openclouders mentioned this pull request Nov 10, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rotating an SVG in the preview cuts off part of the drawing

3 participants