Help needed to rotate photos by changing exifdata orientation

Started by james37, April 30, 2015, 09:46:42 PM

Previous topic - Next topic

james37

Hi,

I'm very new to the exiftool and don't have great knowledge of scripts, however could use some help from someone who is knowledgeable!

I'm putting together a gift (a digital photo frame with lots of pictures on it), however some of the iPhotos (taken with iPhone) are rotated to the left by 90 degrees. These photos are the ones taken in portrait on the iPhone.

When i put them on the digital frame they rotate and thus can't be viewed properly.

I have about 15 photos i need to change the exifdata to make them appear correctly.

I've tried this line exiftool -Orientation <image> and replaced <image> with the directory but am not having much luck....

Any help would be great!

Thanks!

StarGeek

What is the output when you use exiftool -Orientation FILE on one of the incorrect files?  If it's something other than "Horizontal (normal)" then the orientation tag is ok, the problem is that the photo frame isn't reading the orientation and correcting the image.  This is not something that ExifTool can correct.

You'll need to use a different program.  You can either use something like Gimp or Lightroom to rotate it and export it (don't overwrite your original files!) or find a program that can losslessly rotate jpegs.  You don't mention what OS you have but under Windows you can use Irfanview with its JPG Lossless Rotation plugin. 

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

james37

So i'm not getting anything like horizontal or vertical as an output, i have a feeling i may be entering the file in incorrectly.

Am i able to type in  exiftool -Orientation and then drag the photo into the terminal?

Phil Harvey

You should be able to just type "exiftool -orientation ", then drag and drop the file or folder onto the terminal, then press RETURN.

If you don't get anything, then the file(s) likely don't have orientation information, and the images could have been rotated already.  In this case, you can locate the rotated ones using a slightly more complicated command.  Here are two commands that should move all rotated images into a directory called "rotated" in the current directory (use the "pwd" command to see what the current directory is):

exiftool -if '(not $orientation or $orientation =~ /Normal/) and $imageWidth < $imageHeight' -directory=rotated DIR

exiftool -if '$orientation and $orientation =~ /(90|270)/' -directory=rotated DIR

(use double quotes instead of single if you are on Windows)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

james37

thank you! That worked.

Just need to work out how to rotate the ones that need it now! I'll look at other posts

Thanks