Assign Signed value to unsigned GPS altitude

Started by willm, December 06, 2017, 07:34:00 PM

Previous topic - Next topic

willm

Long time listener first time caller...

I am trying to assign a relative altitude value (XMP-drone-dji:RelativeAltitude (real)) to the GPS altitude value (GPS:GPSAltitude(rational64u))

The DJI relative altitude is signed (e.g: +39.6), and the GPS Altitude is unsigned (e.g. 50 m).

When I try to write the relative altitude to gps altitude as below:

exiftool -n -GPS:GPSAltitude=XMP-drone-dji:AbsoluteAltitude dir

I get an error:

Warning: Error converting value for GPS:GPSAltitude (ValueConvInv)
Nothing to do.


Is there a protocol to convert signed to unsigned?


Phil Harvey

Welcome willm,

The problem is you need to use "<" instead of "=" when copying the value of another tag.  "=" is for assigning a literal value.  This is common mistake 5c.

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

willm

Thanks Phil! I knew it would be something silly but could just not figure it out. Working great now, thanks for the fantastic tool!

julianpatterer

Thank you very much for the solution, how can I make it add the "+" sign as well?

-exiftool -n -XMP-drone-dji:AbsoluteAltitude<GPS:GPSAltitude -dir

Phil Harvey

Like this?:

exiftool -n "-XMP-drone-dji:AbsoluteAltitude<+$GPS:GPSAltitude" 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 ($).