rotate-photos
Skill51 starsChanged 3 months agoMITView on GitHub
Bulk rotate photos in an Immich library, by album or asset IDs. Non-destructive, original files are never modified. Supports undo/revert. Use when the user says "rotate photos", "rotate album", "fix rotation", "photos are sideways", "rotate 90", "rotate clockwise", "rotate counterclockwise", "upside down photos", "wrong orientation", "bulk rotate", "rotate multiple", or any variation of wanting to rotate one or more photos.
In this repository12 other files it gives its agents.
- album-managerSkill
- album-reportSkill
- auto-album-curatorSkill
- duplicate-reportSkill
- library-health-reportSkill
- metadata-fixerSkill
- people-reportSkill
- photo-cleanupSkill
- photo-searchSkill
- storage-optimizerSkill
- timeline-gapsSkill
- travel-mapSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
If ping succeeds → proceed with the skill normally.
- Very specific: line 20
If ping fails or the MCP tools are not available → STOP.
- Very specific: line 56
If wrong direction: call again (rotation accumulates) or revert_asset_edits(album_id="...")
- Distinctive: line 57
Clean up: Delete the temporary album when done (photos are not affected)
- Very specific: line 98
Use get_asset_info(asset_id) and check:
- Very specific: line 106
When generating HTML galleries or visual reports, thumbnails must be fetched with ?edited=true to reflect rotation.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rotate Photos
Connection Required: ALWAYS CHECK FIRST
Before doing ANYTHING else in this skill, call ping on the Immich MCP server.
- If
pingsucceeds → proceed with the skill normally. - If
pingfails or the MCP tools are not available → STOP. Do not continue. Tell the user:
Immich is not connected. This plugin needs a running Immich MCP server to work.
Run /setup-immich-photo-manager to configure your Immich connection.
Do NOT skip this check. Do NOT try to run any other tool first. Always ping, always block if it fails.
How It Works
Rotation uses Immich's non-destructive edits API. The original file is never modified. Immich stores the rotation as a display transform that is applied when serving thumbnails and previews.
Key Architecture Details
| Concept | Detail |
| API endpoint | PUT /assets/{id}/edits |
| Storage | Server-side, persists in Immich database forever |
| Original file | Never touched |
| Thumbnails | Served rotated via ?edited=true query parameter |
| Accumulation | Each PUT replaces all edits, so the tool must read the current angle and add |
| Full circle | 360° → edits are deleted entirely (isEdited returns to false) |
MCP Tools
| Tool | Purpose |
rotate_assets | Rotate by album_id or asset_ids. Accumulates with existing rotation. |
revert_asset_edits | Remove all edits (rotation, crop, mirror), back to original. |
Recommended User Workflow
- In Immich web UI: Browse library, spot wrongly-rotated photos
- Multi-select the rotated photos and add them to an album (e.g., "Fix Rotation")
- Use this skill:
rotate_assets(album_id="...", angle=90) - Verify in the Immich web UI: photos should appear rotated
- If wrong direction: call again (rotation accumulates) or
revert_asset_edits(album_id="...") - Clean up: Delete the temporary album when done (photos are not affected)
Rotation Angles
| Angle | Direction | Use when |
| 90 | Clockwise | Photo tilted left |
| 180 | Upside down | Photo inverted |
| 270 | Counter-clockwise | Photo tilted right |
Calling rotate_assets multiple times accumulates:
| Current | + angle | Result |
| 0° | +90° | 90° |
| 90° | +90° | 180° |
| 180° | +90° | 270° |
| 270° | +90° | 0° (edits removed, back to original) |
Examples
Rotate an entire album 90° clockwise
rotate_assets(album_id="uuid-of-album", angle=90)Rotate specific photos 270° (counter-clockwise)
rotate_assets(asset_ids=["uuid-1", "uuid-2", "uuid-3"], angle=270)Undo all rotation on an album
revert_asset_edits(album_id="uuid-of-album")Check current rotation state of an asset
Use get_asset_info(asset_id) and check:
isEdited:trueif any edits existwidth/height: swapped if rotated 90° or 270°
For the exact angle, the tool reads GET /assets/{id}/edits internally.
Showing Results to the User
When generating HTML galleries or visual reports, thumbnails must be fetched with ?edited=true to reflect rotation. The MCP thumbnail tools (get_asset_thumbnail, get_album_thumbnails, get_thumbnails_batch) do this by default.
Limitations
- No auto-detection: There is no reliable way to automatically find wrongly-rotated photos. The user must identify them visually and add them to an album.
- CLIP search doesn't help: Searching for "sideways photo" returns semantically similar images, not actually misrotated ones.
- EXIF orientation: Immich already handles EXIF orientation tags when generating thumbnails. Photos that appear wrong in the UI have a genuine orientation problem that needs manual correction.
- Angle must be a multiple of 90: Arbitrary angles are not supported.
- Images only: Immich's edits API applies to images, not videos, so a video inside a mixed album is not rotated.
get_capabilitiesreports this behaviour for whichever server version is connected, and anything the server rejects comes back in thefailedcount with its reason.
Common Mistakes
| Mistake | Fix |
| Calling rotate_assets twice expecting it to stack without the accumulation fix | The tool handles this: it reads the current angle and adds. No action needed. |
| Trying to detect rotated photos with CLIP search | Don't. Have the user identify them visually and create an album. |
Applying CSS rotation to thumbnails instead of using ?edited=true | Always use the real edited thumbnail from the API. Never fake it with CSS. |
| Forgetting that edits are per-asset, not per-album | A photo rotated in Album A will also appear rotated in Album B. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

