Hi
I am using exftool to generate a tab delineated text file from a batch of jpg files. The file contains the image file name, Latitude, Longitude and image direction/bearing. I have been successful so far but would like to prefiix every gpsimgdirection tag with the text "A=". Is this possible?
Edit: Ahh, Phil's comment makes more sense and I think I misunderstood the question.
According to the spec, the GPSImgDirection holds a 64 bit unsigned rational numeral. You can force whatever value you want into it by adding a hashtag to the end of the tag name or adding -n to the command (see -n (printConv) option (https://exiftool.org/exiftool_pod.html#n---printConv))
-GPSImgDirection#="A=0.1"
or
-n -GPSImgDirection="A=0.1"
as long as you recognize that this may cause problems with any software that can read that tag.
The second option may run into problems in cases when writing other tags that have a conversion from human readable values to machine-readable values. See third example in the above link.
I'm not sure I understand.
Do you want the "A=" in the output tab-delimited text file? If so, show me the command you are using and I'll show you how to add this.
- Phil
Hi Phil
The command I am using is this
exiftool -n -T -filename -gpslatitude -gpslongitude -gpsimgdirection ./ > Photos.txt
This generates the following text
IMG_20191201_105305.jpg 52.3830909727778 -1.75583398333333 358.75
IMG_20191201_105317.jpg 52.3830909727778 -1.75583398333333 181.29
I would like it to read
IMG_20191201_105305.jpg 52.3830909727778 -1.75583398333333 A=358.75
IMG_20191201_105317.jpg 52.3830909727778 -1.75583398333333 A=181.29
Regards
Porridge
OK, try this:
exiftool -n -p "$filename $gpslatitude $gpslongitude A=$gpsimgdirection" ./ > Photos.txt
(although it might be a bit of a challenge getting your desired tab character on the command line between the tag names)
- Phil
worked perfectly - thank you
might be pushing my luck but is there a way to remove the ".jpg" from the filename?
Regards
Porridge
Sure. lots of ways actually. Here is one:
exiftool -n -p "${filename;s/\.\w+$//} $gpslatitude $gpslongitude A=$gpsimgdirection" ./ > Photos.txt
- Phil
wow - ok
It will take me a while to understand how that works - but thank you for your assistance
Regards
Porridge
Search for "advanced formatting feature" in the application documentation (https://exiftool.org/exiftool_pod.html) and this forum for more information.
- Phil