Skip to content
Back to skills

Exif Orientation

ASecurity

Fix images that appear rotated or flipped because EXIF orientation metadata was ignored or double-applied

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
ai-agentsrustgo

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill exif-orientation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Exif Orientation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Exif Orientation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-exif-orientation/badge)](https://www.skillsdirectory.com/skills/black141312-exif-orientation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: exif-orientation
description: Fix images that appear rotated or flipped because EXIF orientation metadata was ignored or double-applied
category: image
---

# EXIF Orientation

Reach for this when photos (often phone camera uploads) show up sideways or upside-down in your app but look correct in the OS file viewer — or vice versa.

1. Reproduce with the actual offending file (orientation bugs are per-file); confirm it looks correct in a viewer that honors EXIF and wrong in your pipeline, or the reverse.
2. Read the EXIF Orientation tag (values 1–8). Values other than 1 mean the stored pixels are rotated/mirrored and metadata says how to display them. `exiftool`, `identify -verbose`, or `PIL.Image.getexif()` will show it.
3. Decide the symptom class: if your app ignores the tag, the image stays in stored (sideways) orientation. If two layers BOTH apply it (e.g. browser auto-rotates AND your code rotates), it gets double-rotated.
4. Normalize once, early: bake the orientation into the pixels (e.g. `ImageOps.exif_transpose`) immediately after decode, then STRIP the orientation tag so nothing downstream re-applies it.
5. Verify across the consumers: thumbnail generator, the viewer/browser, and any re-encode step must all agree — test a sideways and a mirrored sample (orientation 6 and 2 are good probes).
6. Check the encode path too: when you write the corrected image, ensure you don't copy the old orientation tag back into the output.

## Rules
- Apply EXIF orientation exactly once, then remove the tag — double-application is the most common regression.
- Browsers and image CDNs may auto-rotate; account for whether the consumer already honors EXIF before you also rotate.
- Cropping/face-detection/coordinate work must happen AFTER orientation is baked in, or boxes land on the wrong region.
- Test orientation 6 (rotate 90 CW) and 2/4 (mirrored) specifically — plain 180 hides flip vs rotate confusion.
- Don't trust width/height from headers before normalization; a sideways image reports swapped dimensions.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…