ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: vassam on September 17, 2021, 05:28:49 PM

Title: Drone: yaw (-180 to 180) to GpsImgDirection (0-360)
Post by: vassam on September 17, 2021, 05:28:49 PM
Hi! I am trying to replace the GpsImgDirection value with the value of the yaw tag but in the format of 0-360. The yaw values goes from -180 to + 180. So I want the positive values to be copied to the GpsImgDirection value and the negative ones firstly to be added 360 and then be copied.
I tried with the if function to do so but all I get is Warning: Not a floating point number.
Help!
Title: Re: Drone: yaw (-180 to 180) to GpsImgDirection (0-360)
Post by: StarGeek on September 18, 2021, 12:01:34 AM
See this thread (https://exiftool.org/forum/index.php?topic=12832.0) from a couple weeks ago.
Title: Re: Drone: yaw (-180 to 180) to GpsImgDirection (0-360)
Post by: vassam on September 18, 2021, 03:24:48 AM
Yes I saw the thread but when I Tried to apply it for my case a warning pops up.
Warning: Must be a positive number for GPS:GPSImgDirection
I just want to tranform the yaw values of m y images to a 0-360 format (if thery are negative) and then replace the GSPImgDirection value to them.
I don't have a csv.
Title: Re: Drone: yaw (-180 to 180) to GpsImgDirection (0-360)
Post by: StarGeek on September 18, 2021, 09:58:55 AM
Oops, my mistake for not reading more carefully. Your use is much simpler, only requiring the math part of that command.

Try this
exiftool "-GpsImgDirection<${Yaw;$_=$_+($_<0?360:0)}" /path/to/files/
Title: Re: Drone: yaw (-180 to 180) to GpsImgDirection (0-360)
Post by: vassam on September 19, 2021, 02:58:45 PM
It works like a charm. Thank you so much!!!
Title: Re: Drone: yaw (-180 to 180) to GpsImgDirection (0-360)
Post by: GoodKarma on November 15, 2022, 12:41:59 PM
Quote from: StarGeek on September 18, 2021, 09:58:55 AMOops, my mistake for not reading more carefully. Your use is much simpler, only requiring the math part of that command.

Try this
exiftool "-GpsImgDirection<${Yaw;$_=$_+($_<0?360:0)}" /path/to/files/

does this command only work on images with a negative YAW. I just come across this issue with some of my drone files
Title: Re: Drone: yaw (-180 to 180) to GpsImgDirection (0-360)
Post by: Phil Harvey on November 15, 2022, 02:02:26 PM
The command add 360 to the angle if the value is negative.

- Phil
Title: Re: Drone: yaw (-180 to 180) to GpsImgDirection (0-360)
Post by: GoodKarma on November 15, 2022, 03:22:23 PM
Quote from: Phil Harvey on November 15, 2022, 02:02:26 PMThe command add 360 to the angle if the value is negative.

- Phil

Thanks