Can't test XMP-crs:ToneCurveName?

Started by jimo, August 27, 2012, 01:27:41 PM

Previous topic - Next topic

jimo

I'm using Exiftool 9.01 on a Mac with Snow Leopard. I'm trying to test the files in a directory to find the ones that have been modified... the mods were done on an iPad, if it matters. In particular, I'm looking for files that have the ToneCurveName tag set to 'Custom'. Here's what I see:


MyiMac:Jim jimo$ exiftool -XMP-crs:all -X P1060200-1.JPG

<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about='P1060200-1.JPG'
  xmlns:et='http://ns.exiftool.ca/1.0/' et:toolkit='Image::ExifTool 9.01'
  xmlns:XMP-crs='http://ns.exiftool.ca/XMP/XMP-crs/1.0/'>
<XMP-crs:AlreadyApplied>False</XMP-crs:AlreadyApplied>
<XMP-crs:Vibrance>6.77519</XMP-crs:Vibrance>
<XMP-crs:ToneCurve>
  <rdf:Bag>
   <rdf:li>20, 0</rdf:li>
   <rdf:li>84, 66</rdf:li>
   <rdf:li>130, 132</rdf:li>
   <rdf:li>172, 194</rdf:li>
   <rdf:li>233, 255</rdf:li>
  </rdf:Bag>
</XMP-crs:ToneCurve>
<XMP-crs:ToneCurveName>Custom</XMP-crs:ToneCurveName>
<XMP-crs:FillLight>7.19264</XMP-crs:FillLight>
</rdf:Description>
</rdf:RDF>


So, the file does contain the tag and its value is 'Custom'. But when I try the -if option, I get


MyiMac:Jim jimo$ exiftool -if '$XMP-crs:ToneCurveName=Custom' -filename P1060200-1.JPG
    1 files failed condition


and

MyiMac:Jim jimo$ exiftool -if '$XMP-crs:ToneCurveName = Custom' -filename P1060200-1.JPG
    1 files failed condition
MyiMac:Jim jimo$ exiftool -if '$XMP-crs:ToneCurveName =~ Custom' -filename P1060200-1.JPG
    1 files failed condition


So... what am I doing wrong?  Thanks.

jimo

OK... I finally came up with the correct syntax:


MyiMac:Jim jimo$ exiftool -if '$XMP-crs:ToneCurveName = "Custom"' -filename P1060200-1.JPG
File Name                       : P1060200-1.JPG


or


MyiMac:Jim jimo$ exiftool -if '$XMP-crs:ToneCurveName =~ /Custom/' -filename P1060200-1.JPG
File Name                       : P1060200-1.JPG


Will work.

Phil Harvey

Hi Jim,

Quote from: jimo on August 27, 2012, 02:03:18 PM

MyiMac:Jim jimo$ exiftool -if '$XMP-crs:ToneCurveName = "Custom"' -filename P1060200-1.JPG
File Name                       : P1060200-1.JPG

Close, but not quite.  You need to use "eq" instead of "=".

"=" is the assignment operator
"eq" is the string comparison operator, which is what you want

Quote
MyiMac:Jim jimo$ exiftool -if '$XMP-crs:ToneCurveName =~ /Custom/' -filename P1060200-1.JPG
File Name                       : P1060200-1.JPG

Yes.  This is the proper way to search for a substring.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

jimo