News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

GPS and rational64

Started by martinthomas, November 01, 2021, 01:17:32 PM

Previous topic - Next topic

martinthomas

I use Picasa to refine GPS location of images held on a local OneDrive folder.  After returning to a previously edited image, I have now discovered that OneDrive is overwriting my edited file with an older version.  What I have found is that OneDrive uploads the edited file as expected but shortly afterwards downloads an unedited version of the file (Microsoft are looking into this).

I am trying to find out how long this has been happening.

Using the Exiftool verbose option to investigate, I have found that there is a subtle difference between the GPS values in the original unedited version of the file and the GPS values in the OneDrive downloaded file.  The OneDrive downloaded file GPS values for seconds have been rounded.

Original unedited file
  GPSLatitudeRef = N
  GPSLatitude = 51 45 28.89404297 (51/1 45/1 59175/2048)
  GPSLongitudeRef = W
  GPSLongitude = 0 39 3.495583534 (0/1 39/1 3665385/1048576)

Edited file Uploaded
  GPSLatitudeRef = N
  GPSLatitude = 51 45 17.70172119 (51/1 45/1 290025/16384)
  GPSLongitudeRef = W
  GPSLongitude = 0 39 4.730472565 (0/1 39/1 1240065/262144)

Downloaded/overwritten file
  GPSLatitudeRef = N
  GPSLatitude = 51 45 28.894 (51/1 45/1 288940/10000)
  GPSLongitudeRef = W
  GPSLongitude = 0 39 3.4955 (0/1 39/1 34955/10000)

Although this subtle change is not significant in itself, it could indicate to me files which have been overwritten and need re-editing.   I am wondering if there is any way I could identify files with a rational64 denominator for seconds = 10000?

StarGeek

I don't believe there's a way to see the raw rational numbers outside of the -v (-verbose) option and no way to filter them.

Also be aware that OneDrive is not a backup for images.  It is editing your files.  See this thread on Microsoft.com.
* 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).

Phil Harvey

Actually, I just realized there is a tricky way to show the rational values:

exiftool -p "${gpslatitude;$_=$self->GetValue($tag,'Rational')}, ${gpslongitude;$_=$self->GetValue($tag,'Rational')}" FILE

So you could filter on them like this:

exiftool -filename -if "${gpslatitude;$_=$self->GetValue($tag,'Rational')} =~ m(/10000)" 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 ($).

StarGeek

Quote from: Phil Harvey on November 01, 2021, 04:26:24 PM
exiftool -p "${gpslatitude;$_=$self->GetValue($tag,'Rational')}, ${gpslongitude;$_=$self->GetValue($tag,'Rational')}" FILE

When I copy/paste that command, I get an undef warning

C:\>exiftool -g1 -a -s -gpsl* y:\!temp\Test4.jpg
---- GPS ----
GPSLatitudeRef                  : North
GPSLatitude                     : 40 deg 41' 21.12"
GPSLongitudeRef                 : West
GPSLongitude                    : 74 deg 2' 40.20"
---- Composite ----
GPSLatitude                     : 40 deg 41' 21.12" N
GPSLongitude                    : 74 deg 2' 40.20" W

C:\>exiftool -p "${gpslatitude;$_=$self->GetValue($tag,'Rational')}, ${gpslongitude;$_=$self->GetValue($tag,'Rational')}"  y:\!temp\Test4.jpg
Warning: [Minor] Advanced formatting expression returned undef for 'gpslatitude' - y:/!temp/Test4.jpg
* 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).

Phil Harvey

Ah, yes.  It will do that for Composite:GPSLatitude.  I didn't have the reference directions in my test file, which is why it worked for me.  Try this instead:

exiftool -p "${gps:gpslatitude;$_=$self->GetValue($tag,'Rational')}, ${gps:gpslongitude;$_=$self->GetValue($tag,'Rational')}" 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 ($).

StarGeek

* 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).

martinthomas

Thanks for your help.  Phil's solution worked result = 51/1 45/1 59175/2048, 0/1 39/1 3665385/1048576
51/1 45/1 288940/10000, 0/1 39/1 34955/10000.

Perhaps the most important thing I have learnt is not to use OneDrive as a backup (unfortunately I have been using One Drive for some time as a back up images and to sync data onto another computer)

Martin

martinthomas

My only problem now is how to include commands for outputting directory and file name and make it recursive.

Martin

StarGeek

Quote from: martinthomas on November 03, 2021, 01:02:29 AM
My only problem now is how to include commands for outputting directory and file name and make it recursive.

exiftool -r -p "$FilePath, ${gps:gpslatitude;$_=$self->GetValue($tag,'Rational')}, ${gps:gpslongitude;$_=$self->GetValue($tag,'Rational')}" /path/to/files/
* 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).

martinthomas

Thanks StarGeek - that worked perfectly.  Martin