ExifTool Forum

General => Metadata => Topic started by: juju22 on December 20, 2012, 05:47:37 PM

Title: handling manometer metadata
Post by: juju22 on December 20, 2012, 05:47:37 PM
Hello,

I want to tag my underwater pictures automatically. I was thinking to do something like

exiftool -if "(\$model=~/uTough-8010/ and not \$manometerreading=~/0 m, 0 ft/)" -r -ext jpg -keywords+='undersea' $Todo/


problem is, it seems I can't do greater or lower than as fields are text like
Manometer Pressure              : 110 kPa
Manometer Reading               : -0.5 m, -3 ft
$ exiftool -if "(\$model=~/uTough-8010/ and not \$manometerreading=~/0 m, 0 ft/)" -r -ext jpg ~/Images/20121207/*PC*{763,765}.JPG | egrep -i '(file name|manometer)'
File Name                       : 20121207_102413--PC072765.JPG
Manometer Pressure              : 110 kPa
Manometer Reading               : -0.5 m, -3 ft
$ exiftool -if "(\$model=~/uTough-8010/ and not \$manometerreading</0 m, 0 ft/)" -r -ext jpg ~/Images/20121207/*PC*{763,765}.JPG | egrep -i '(file name|manometer)'
$

same with '<0'

any way to do that ?
problem can probably applied to both reading and pressure as elevation is not sufficient alone to say that you are underwater.

Thanks a lot
Title: Re: handling manometer metadata
Post by: Phil Harvey on December 26, 2012, 03:52:09 PM
Sorry for the delay in responding.  Somehow I missed reading this post.

To test the numbers separately numerically, you could do this:

-if "$manometerreading =~ /([-\d.]+) m, ([-\d.]+) ft/ and $$1 > 0 and $$2 > 0"

Here $$1 should be the numerical altitude in metres, and $$2 is in feet.  (These are the values captured inside the brackets of the regular expression.)  You can test either or both in the condition.

- Phil
Title: Re: handling manometer metadata
Post by: juju22 on January 05, 2013, 06:03:50 PM
Great!!!

So powerful exiftool :)

Thanks Phil!
Title: Re: handling manometer metadata
Post by: Phil Harvey on January 05, 2013, 07:19:26 PM
I may have got my quoting wrong.  I had thought you were on Windows, but I notice now that you backslashed your dollar symbols, so I think I was wrong.  On Mac/Linux my previous command should have single quotes instead of double.

- Phil