@user7963's answer to use
exiftran is right, but how do we use it? Here's what I found:
Tested on Ubuntu 20.04:
sudo apt update
sudo apt install exiftran
*.jpg images in
dir_of_images to be automatically rotated in place according to their exif orientation metadata:
exiftran -ai *.jpg
That's it! All
*.jpg images will now have been rotated in place!
man exiftran or
exiftran -h for help and details.
Here are what the two options I used (
-a Automatic (using exif orientation tag).
-i Enable in-place editing of the images. Exiftran allows
multiple input files then. You must specify either this
option or a output file with -o for all operations which
modify the image (i.e. everything but -d right now).