How to copy the 90º rotation tag of a vertical shot?

Started by hurodal, October 01, 2012, 03:40:13 PM

Previous topic - Next topic

hurodal

hi there,

This is my first post here. First of all, thanks to all of you that contributed to such a great tool, specially to Phil.

I want to ask a question. Recently I wanted to emulate direct in-camera JPEGs for a special panorama software that doesn't accept anything but JPEGs from camera. I sucessfully emulated the image and copied almost all metadata from an original JPEG, except one problem:

the original shots are vertical and, as you may know, they actually are landscape oriented but with a special tag to rotate them. I could not copy this tag using EXIFTool GUI in windows.

how can I achieve this?

Thanks in advance!

Hugo

Phil Harvey

Hi Hugo,

I don't know how to do this via the GUI, but at the command line:

exiftool -tagsfromfile source.jpg -orientation destination.jpg

- 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 ($).

hurodal

Hi Phil,

thank you for the clarifying. I actually did a mistake; I did the copy with EXIFCopier (http://exifcopier.110mb.com/, which seems to not work properly) and not EXIFtool GUI. I tried it now with EXIFTool and EXIFToolGUI and it worked! in the last one you only have to check the orientation tag and use the copy tags from all files from a folder to another, so you can process a big number of files without having to process one by one.

Now I'm gonna see if it works or not.

thanks very much!

fotojonic

Hi Phil,

is it possible to extract the previews from multiple files and to also pass the orientation exif?

I'm writing a node.js app to remotely review and select my raws, the following command is sucessfully generating the previews for all my RAW files but the generated jpgs don't have orientation EXIF info.

/drives/c/Users/iies0073/Dropbox/bins/_IMG/exiftool.exe -b -PreviewImage -w -PREVIEW.jpg /drives/c/Users/iies0073/Dropbox/_TODO/node.js/teste4/RAWSTESTE



[2019-05-17 17:00.45]  /drives/c/Users/iies0073/Dropbox/_TODO/node.js/teste4/RAWSTESTE
[iies0073.IIES227-068] ➤ exiftool.exe Fotojonic-018-N-aurele2-20181218.NEF | grep -i orientation
Orientation                     : Rotate 270 CW


[2019-05-17 17:01.01]  /drives/c/Users/iies0073/Dropbox/_TODO/node.js/teste4/RAWSTESTE
[iies0073.IIES227-068] ➤ exiftool.exe Fotojonic-018-N-aurele2-20181218-PREVIEW.jpg | grep -i orientation

this is the full exif from a generated jpg thumbnail:
[iies0073.IIES227-068] ➤ exiftool.exe Fotojonic-018-N-aurele2-20181218-PREVIEW.jpg
ExifTool Version Number         : 9.39
File Name                       : Fotojonic-018-N-aurele2-20181218-PREVIEW.jpg
Directory                       : .
File Size                       : 100 kB
File Modification Date/Time     : 2019:05:17 16:58:13+01:00
File Access Date/Time           : 2019:05:17 16:58:13+01:00
File Creation Date/Time         : 2019:05:17 16:58:13+01:00
File Permissions                : rw-rw-rw-
File Type                       : JPEG
MIME Type                       : image/jpeg
Image Width                     : 570
Image Height                    : 375
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Image Size                      : 570x375






Phil Harvey

You can copy the orientation like this:

exiftool -tagsfromfile SOURCE_FILE -orientation PREVIEW_FILE

- 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 ($).

fotojonic

Thank you for the help and for providing this wonderful tool that i have been using for a long time!

I'm currently extracting the previews for all the files in a folder at once, then i cycle through the previews one by one to copy the orientation info from the rawfile to the preview file and finally i'm able to auto rotate the images with mogrify:

    exiftool.exe -b -PreviewImage -w -PREVIEW.jpg RAWFILES/
    for i in...
      exiftool -tagsfromfile 'Fotojonic-018-N-aurele2-20181218.NEF' -orientation 'Fotojonic-018-N-aurele2-20181218-PREVIEW.jpg'
      mogrify.exe -auto-orient 'Fotojonic-018-N-aurele2-20181218-PREVIEW.jpg'
    done
 

I'll be runing this from a webapp that i'm developing to review my imported raw photos.

Do you think there is a better/faster way to do this with exiftool or should i stop to try to improve the process and run with it?




Phil Harvey

This command will copy the Orientation for all files in a folder:

exiftool -tagsfromfile %d/%-.8f.NEF -orientation -ext jpg DIR

- 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 ($).