ExifTool Forum

General => Metadata => Topic started by: aazimmy12 on June 15, 2022, 05:22:02 PM

Title: Subtracting values from tags
Post by: aazimmy12 on June 15, 2022, 05:22:02 PM
I am trying to subtract a number from a tag and have been using exiftool -tag-=90 image.JPG but it will not work.
Title: Re: Subtracting values from tags
Post by: StarGeek on June 15, 2022, 05:49:31 PM
See the -TAG[+-^]=[VALUE] option (https://exiftool.org/exiftool_pod.html#TAG---VALUE).

...  += and-= are used to add or remove existing entries from a list, or to shift date/time values (see Image::ExifTool::Shift.pl and note 6 below for more details). += may also be used to increment numerical values (or decrement if VALUE is negative), and -= may be used to conditionally delete or replace a tag...

The first and last part details what you can do with -=.  It can remove an item from a list type tag, shift a date/time value negatively, or conditionally remove/replace a tag.

As per the middle part, you would use += with a negative number to subtract from a numbered value.
exiftool -tag+=-90 file.jpg