EXIF orientation.

One number, eight possible values, and the reason a naive scrubber hands you back a folder of sideways photographs.

// definition

EXIF orientation is tag 0x0112 in IFD0: a single SHORT, values 1 through 8, telling a viewer how to rotate or flip the stored pixels before displaying them.

What it is

Phones do not rotate pixels when you turn them sideways. The sensor writes its native orientation and the phone records a tag saying "turn this a quarter turn clockwise before showing it". Value 1 means upright; 3 is 180°; 6 and 8 are the two quarter turns; the even values in between include mirroring.

Why it matters

The tag lives in EXIF. Drop EXIF and the instruction goes with it, and every portrait photograph in the folder now displays on its side. This is not a hypothetical failure — it is the single most common complaint about metadata strippers, and it is why people stop using them.

The alternative, rotating the actual pixels to match, means decoding and re-encoding the image. That loses quality and forfeits the only claim worth making.

// in ScrubPony ScrubPony drops the original EXIF block entirely and writes back a minimal 36-byte replacement holding exactly one field: the orientation. That is the only place in the whole program that writes metadata rather than removing it, and the justification is that the field identifies nobody — it says which way up the picture goes, which anyone can see by looking at it. Nothing is emitted when the orientation is 1 or absent. --no-keep-orientation drops it too, for whom the angle the phone was held at is itself a signal.

Related terms

Common questions.

Why 36 bytes?

An APP1 marker and length, the six-byte Exif identifier, an eight-byte TIFF header, a two-byte entry count, one twelve-byte directory entry, and a four-byte null next-IFD pointer. The last field is what guarantees no thumbnail can follow.

Does the re-emitted block identify me?

It records that the photograph was taken with the camera held a particular way, which is visible in the picture anyway. If that is still too much, --no-keep-orientation drops it and your rotated photos will display sideways.

Why does a scrubbed file still report a dropped segment?

Because policy drops our own orientation block too, then writes a fresh one. That is why --check counts identifying segments rather than dropped ones — otherwise every rotated photo would report dirty forever.

Get ScrubPony

Strips identifying metadata out of JPEGs without touching a pixel. C99, no dependencies beyond libc, macOS and Linux, MIT-licensed.