Copy data from JPG to RAW?

Started by neil40, January 26, 2017, 06:03:10 AM

Previous topic - Next topic

neil40

Hi,

I'm after a bit of guidance please.
My camera (Fujifilm Finepix S200EXR) is set to store JPG and RAW (RAF files)
It has no GPS, so following a recent trip to the USA, I found that I could map my pictures (I chose to do the JPG's) in Geosetter, which of course uses exiftool under the bonnet.
As there are a lot of pictures, it would be quite a task to go through all the RAW files in this way, so I started to look at exiftool as a method to do this.

I wonder if others have done this, by reading the location data from the (modified) JPG file then writing it to the RAW file
I'd be most grateful for some tips on doing this if it's possible.

Many thanks
Neil

Phil Harvey

Hi Neil,

The command to copy GPS from JPG to RAF would be:

exiftool -tagsfromfile %d%f.JPG -gps:all -ext raf DIR

But I don't know how much support there will be out there for reading GPS from RAF files.

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

neil40

Brilliant, thanks.

In the interim I was searching through posts and was 'almost' at this answer, apart from the last part, I had seen the -tagsformfile and -gps:all mentioned.

Now to test.

Thanks again.
Neil

neil40

Hmm. What am I doing wrong?!!

I opened a Command prompt in the folder where the JPG files are. The RAF files are in a sub-directory called RAF Files

I issued the command
exiftool -tagsfromfile %d%f.jpg -gps:all -ext raf "E:\New England 2\2016-10-24\RAF Files"

and each file gives the error:
Warning: Error opening file - E:/New England 2/2016-10-24/RAF Files/DSCF1509.jpg (IE one error for each JPG file)

Phil Harvey

Does the JPG file exist?  If you are on a case-sensitive filesystem you may need a capital "JPG" in your command.

- Phil

Edit: Oh, right.  Backslashes.  You're on Windows, so probably not case sensitive.
...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 ($).

neil40

Quote from: Phil Harvey on January 26, 2017, 07:23:34 AM
Does the JPG file exist?  If you are on a case-sensitive filesystem you may need a capital "JPG" in your command.

- Phil

Edit: Oh, right.  Backslashes.  You're on Windows, so probably not case sensitive.
Just tried that, same error! Yes, the files exist, so JPG files in the 2016-10-24 folder and RAF files in 2016-10-24\RAF files folder. Executing the exiftool command from the JPG folder
I wonder, they are on an external hard drive, so I wonder if there is a write permission problem.

Phil Harvey

My command assumed they were in the same folder.  Use this command if the JPG's are one level up:

exiftool -tagsfromfile %-:1d%f.jpg -gps:all -ext raf "E:\New England 2\2016-10-24\RAF Files"

or if you had already "cd"-d to the JPG directory, then this would work:

exiftool -tagsfromfile %f.jpg -gps:all -ext raf "RAF Files"

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

neil40

Quote from: Phil Harvey on January 26, 2017, 07:32:43 AM
My command assumed they were in the same folder.  Use this command if the JPG's are one level up:

exiftool -tagsfromfile %-:1d%f.jpg -gps:all -ext raf "E:\New England 2\2016-10-24\RAF Files"

or if you had already "cd"-d to the JPG directory, then this would work:

exiftool -tagsfromfile %f.jpg -gps:all -ext raf "RAF Files"

- Phil
Bingo! Thanks so much

neil40

One further question if I may.

I used Geosetter to get Altitude and 'Location' using it's 'Get From Web' buttons for example, on a location in Boston Decimal 42.35738200, -71.06080400 it returns me:
Country Code USA
Country United States
State/Province Massachusetts
City Boston
Sublocation Boston

Are these written to the JPG file too, or are they unique to Geosetter perhaps?
IE could I also use exiftool arguments to pull these to the RAF file too?

Phil Harvey

Use this command to see all metadata available in the file:

exiftool -a -G1 -s FILE

You can use ExifTool to copy any of this.

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

neil40

Quote from: Phil Harvey on January 26, 2017, 07:53:35 AM
Use this command to see all metadata available in the file:

exiftool -a -G1 -s FILE

You can use ExifTool to copy any of this.

- Phil
Ah, brilliant, yes, I see it wrote it to sections in [IPTC] and [XMP].
I need to get reading your website to find the correct arguments now.

Phil Harvey

It's easy.  Just add all of the tags you want to copy, like this:

exiftool -tagsfromfile %f.jpg -gps:all -TAG1 -TAG2 -TAG3 ... -ext raf "RAF Files"

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

neil40


neil40

#13
Quote from: Phil Harvey on January 26, 2017, 08:05:06 AM
It's easy.  Just add all of the tags you want to copy, like this:

exiftool -tagsfromfile %f.jpg -gps:all -TAG1 -TAG2 -TAG3 ... -ext raf "RAF Files"

- Phil
Phil, trying to find the right options to use to achieve what I want as my previous reply and found there is a -all:all option for -tagsfromfile

Is this a sensible option to use to copy data from JPG to RAF file, or could there be some data that isn't right to copy?

Thanks
Neil

edit - mmm, it seems that this might not be a great idea as it crashed geosetter on a test image

Phil Harvey

NO.  Don't do that!

Be careful what you copy to a RAW file.  It is not advisable to change any of the maker notes because they may contain information necessary for proper rendering of the image (WhiteBalance for example).

Something like -xmp:all and -iptc:all would be more reasonable.

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