Skip to content

feat(viewer): add visual image rotation (90° steps)#3190

Open
vladopol wants to merge 1 commit into
nextcloud:masterfrom
vladopol:feat/image-rotation
Open

feat(viewer): add visual image rotation (90° steps)#3190
vladopol wants to merge 1 commit into
nextcloud:masterfrom
vladopol:feat/image-rotation

Conversation

@vladopol
Copy link
Copy Markdown

@vladopol vladopol commented Jun 2, 2026

Summary

Adds rotate left / rotate right buttons to the image viewer toolbar for JPEG, PNG and WebP files.

  • Two inline toolbar buttons: Rotate counterclockwise (↺) and Rotate clockwise (↻)
  • Visual-only rotation via CSS transform: rotate()no file modification
  • Smooth 0.2s CSS transition
  • Rotation resets automatically when navigating to the next/previous image
  • Zoom is reset on each rotation step
  • Buttons are shown only for image files (jpeg/png/webp), not for video/audio

Motivation

When a photo is taken or shared with incorrect orientation (e.g. portrait vs landscape), there is currently no way to adjust the view without leaving the viewer. This PR addresses issues #1846, #2804, #327, #65 with a minimal, non-destructive implementation.

Screenshots

Before After
No rotation controls ↺ ↻ buttons in toolbar

Test plan

  • Open a JPEG/PNG/WebP image in the viewer
  • Rotate right: image rotates 90° clockwise with smooth animation
  • Rotate left: image rotates 90° counterclockwise
  • After 4 clicks in one direction the image is back to original
  • Navigate to next/previous image: rotation resets to 0°
  • Buttons do NOT appear for video or audio files
  • Zoom still works after rotation

Notes

This is a visual-only rotation. It does not modify the file or EXIF data. A separate feature (with file write permission) could be added to persist the rotation — but that is out of scope for this PR.

Add rotate left/right buttons to the image viewer toolbar.
Rotation is visual-only (CSS transform), no file modification.
Buttons appear inline in the header for images (jpeg/png/webp).
Rotation resets when navigating to next/previous image.
Smooth 0.2s transition on rotate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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