Change Orientation of NEF Files in EXIF Data

From Littledamien Wiki
Revision as of 14:37, 21 January 2025 by Video8 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Use exiftool on the command line to edit EXIF data of NEF files to control their orientation.

$ exiftool -orientation#=1 [myfile.NEF]
Orientation Values
Horizontal (normal)
Mirror horizontal
Rotate 180
Mirror vertical
Mirror horizontal and rotate 270 CW
Rotate 90 CW
Mirror horizontal and rotate 90 CW
Rotate 270 CW

The orientation is relative to the files original orientation, so for example applying a 90 CW rotation 3 times will leave the file rotated 90 degrees, not 270 degrees.

An alternate method:

$ exiftool -orientation="Rotate 90 CW" myfile.NEF

orientation values:

Rotate 90 CW
Rotate 180 CW
Rotate 270 CW

Note that sips can also be used to rotate images.

sips -r 90 path/to/file.jpg --out rotatedfile.jpg

See also[edit]