ExifTool Forum

ExifTool => Newbies => Topic started by: aazimmy12 on June 22, 2022, 01:16:21 PM

Title: Subtracting values from tags
Post by: aazimmy12 on June 22, 2022, 01:16:21 PM
Hi! I am currently having a problem subtracting a value from my tag on my photos. I used the line -exiftool -degree+=-10 and it says "Warning: Can't shift degree (not a number) - photo.JPG" even though the degree tag has a value of 2.342. I am not sure what I am doing wrong and would really appreciate some help!
Title: Re: Subtracting values from tags
Post by: StarGeek on June 22, 2022, 03:19:29 PM
What is the exact tag name and group?  Use the command in FAQ #3 (https://exiftool.org/faq.html#Q3) to see.

Looking through the tag names pages (https://exiftool.org/TagNames/), I don't see any tag called simply "Degree".  So the name is either something else or it's a tag exiftool can't write.
Title: Re: Subtracting values from tags
Post by: aazimmy12 on June 22, 2022, 03:39:04 PM
I figured out the problem was that there a bunch of extra spaces before the actual value of the tag like this Degree:            1.234 , and when I set the value of the tag to 1.234 of the tag the subtraction works. However, I need to do this for over 1,000 photos so is there any way to remove the spaces before the value of my tag when they all the degree tags have different values?
Title: Re: Subtracting values from tags
Post by: Phil Harvey on June 23, 2022, 06:44:57 AM
You can remove all of the spaces from a writable TAG for all writable files in directory DIR like this:

exiftool -tagsfromfile @ -TAG -api filter="tr/ //d" DIR

- Phil

Edit:  Please don't double post.  StarGeek had already answered your question here (https://exiftool.org/forum/index.php?topic=13677.0).