ExifTool Forum

ExifTool => Newbies => Topic started by: eXistenZ on November 10, 2016, 05:46:05 AM

Title: GPS coordinates from Jpeg to RAW (ARW)
Post by: eXistenZ on November 10, 2016, 05:46:05 AM
Hallo, I'm very new to command line tools so I need help from the community to solve my problem.

PROBLEM:
- I shoot with a Sony A6300 saving RAW+Jpeg on an Eye-fi SD card
- It sends both RAW and Jpeg to my Tablet, in which the jpeg is geotagged by Eye-fi app.
- When I import all in Lightroom, it reads metadata from the raw, loosing GPS coordinates (jpeg can be imported as a sidecar file of the RAW or as a separate image, in both cases RAW is not geotagged)

I managed to use exiftool to read metadata from all JPG files in a folder and save them as XMP file, and this could be a solution, but sometimes I have preexisting XMPs for some photos an I don't want to overwrite them.

My question is:
- It is possible (and how) to read GPS coordinates only from .JPG and add them directly in the corresponding (same filename) .ARW?
Of course in batch.

Thank you
Title: Re: GPS coordinates from Jpeg to RAW (ARW)
Post by: Phil Harvey on November 10, 2016, 08:20:25 AM
To add the GPS to an existing XMP sidecar file (or create a new one if it doesn't exist):

exiftool -ext jpg -tagsfromfile @ -@ gps2xmp.args -srcfile %d%f.xmp DIR

or add GPS to the ARW file:

exiftool -ext arw -tagsfromfile %d%f.jpg -gps:all DIR

The first command uses the "gps2xmp.args" file found in the full ExifTool distribution to convert EXIF GPS tags to XMP.  The second command copies the tags as EXIF GPS (no need to convert to XMP).

- Phil
Title: Re: GPS coordinates from Jpeg to RAW (ARW)
Post by: eXistenZ on November 10, 2016, 09:10:26 AM
First of all Thank you so much for the help.

I tested both:

exiftool -ext jpg -tagsfromfile @ -@ gps2xmp.args -srcfile %d%f.xmp DIR
results in an error message "Error opening arg file gps2xmp.args"
I'm woking on Mac OS 10.10.5, I installed Exiftool from the DMG package, then downloaded Image-ExifTool-10.32.tar.gz, and followed instructions regarding Full Perl Distribution. Where I need to move gps2xmp.args?

exiftool -ext arw -tagsfromfile %d%f.jpg -gps:all DIR
Instead apparently works fine, I tested on just one image and received two Warning messages
Warning: [minor] Error reading PreviewImage - /Users/existenz/Pictures/Libreria Lightroom/prova/_DSC0123.jpg
Warning: [minor] Entries in SubIFD were out of sequence. Fixed. - /Users/existenz/Pictures/Libreria Lightroom/prova/_DSC0123.ARW
Anyway it apparently added GPS data correctly to the RAW and also created a backup (_DSC0123.ARW_original)
Are those warnings relevant?
Title: Re: GPS coordinates from Jpeg to RAW (ARW)
Post by: Phil Harvey on November 10, 2016, 09:30:28 AM
Quote from: eXistenZ on November 10, 2016, 09:10:26 AM
results in an error message "Error opening arg file gps2xmp.args"

You need to either copy "gps2xmp.args" into the current directory from the "arg_files" directory of the distribution, or specify the path to the .args file in your command.

Quote
Are those warnings relevant?

They shouldn't cause any problems.

- Phil
Title: Re: GPS coordinates from Jpeg to RAW (ARW)
Post by: Phil Harvey on November 10, 2016, 09:32:19 AM
Quote from: eXistenZ on November 10, 2016, 09:10:26 AM
I'm woking on Mac OS 10.10.5, I installed Exiftool from the DMG package, then downloaded Image-ExifTool-10.32.tar.gz, and followed instructions regarding Full Perl Distribution.

I hope you didn't install both versions.  All you need is the "gps2xmp.args" file from the .tar.gz distribution.

- Phil
Title: Re: GPS coordinates from Jpeg to RAW (ARW)
Post by: eXistenZ on November 10, 2016, 09:54:04 AM
Quote from: Phil Harvey on November 10, 2016, 09:32:19 AM
I hope you didn't install both versions...

I think I did, first I used the mac PKG to install exiftool, then, trying to solve gps2xmp.args error, i followed these instructions:
QuoteFull Perl Distribution

Download the Image-ExifTool distribution from the ExifTool home page to your Desktop.
(The file you download will have a name like "Image-ExifTool-10.32.tar.gz".)
Launch the Terminal application from the Utilities folder in your Applications folder.
In the Terminal window, type the following:
    cd ~/Desktop
    tar -xzf Image-ExifTool-10.32.tar.gz
    cd Image-ExifTool-10.32
    sudo cp -r exiftool lib /usr/local/bin
(Note: The last step above will require you to enter your password.)
You can now run exiftool by typing "exiftool" in a Terminal window.

but I think it simply copied and overwrote exiftool  and lib folder in /usr/local/bin.

Anyway I solved gps2xmp.args by copying it in the current folder

Thank you again for the help
Title: Re: GPS coordinates from Jpeg to RAW (ARW)
Post by: Phil Harvey on November 10, 2016, 10:12:47 AM
OK.  You just installed it in /usr/local/bin over top of the DMG-installed version.  No problems then.

- Phil