ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: rlindenf on July 12, 2011, 09:58:58 AM

Title: hierarchicalkeywords Adobe Bridge
Post by: rlindenf on July 12, 2011, 09:58:58 AM
Hello Folks-

I'm trying to write to the keywords in JPGs to be used in Adobe Bridge, using the command line exiftool.

The following code does not work:

exiftool -hierarchicalkeywords+="{keyword=Business_Unit,children={keyword=IWS}}" /Users/a351958/Desktop/newTest/FM_001_Header.jpg


Any help would be appreciated.

-RL

The keyword structure I've built is listed below.

Module_Header
   Account Owner
   Bank Information
   Capital Gains Distributions
   Smart Payment Program
   Investment Options
Business_Unit
   FCM
   FIIS
   FOS
   IWS
   NF
Product_Designation
   Non-Retirement
   Retirement
Product_line
   401k
   403b
   529
   Cash Management
   Destiny
   FIMM
   Massachusetts
   North Carolina
   SEP
   Simple
Title: Re: hierarchicalkeywords Adobe Bridge
Post by: Phil Harvey on July 12, 2011, 10:13:14 AM
Does Bridge use the new MWG hierarchical keywords?  Cool.

I suggest writing the keywords you want with Bridge, then use exiftool to see how they are stored:

exiftool -a -G1 -struct test.jpg

You should see an XMP-mwg-kw:KeywordInfo structure if it supports the hierarchical MWG keywords.

What you have done looks good to me, so my suspicion is that Bridge isn't supporting the MWG keywords.  What version of Bridge are you using?

- Phil
Title: Re: hierarchicalkeywords Adobe Bridge
Post by: rlindenf on July 12, 2011, 12:34:11 PM
Bridge CS3, on an intel Mac

when I have the child "FIIS" of keyword "Business_Unit"; and child "401k" of keyword "Product Line" selected, I get the following output:


"[ExifTool]      ExifTool Version Number         : 8.60
[System]        File Name                       : FM_001_Header.jpg
[System]        Directory                       : Users/a351958/Desktop/newTest
[System]        File Size                       : 34 kB
[System]        File Modification Date/Time     : 2011:07:12 11:19:09-04:00
[System]        File Permissions                : rw-r--r--
[File]          File Type                       : JPEG
[File]          MIME Type                       : image/jpeg
[File]          Current IPTC Digest             : 763ce36211538c758e3b41466f45db50
[File]          Image Width                     : 612
[File]          Image Height                    : 792
[File]          Encoding Process                : Baseline DCT, Huffman coding
[File]          Bits Per Sample                 : 8
[File]          Color Components                : 3
[File]          Y Cb Cr Sub Sampling            : YCbCr4:4:4 (1 1)
[XMP-x]         XMP Toolkit                     : Adobe XMP Core 4.2-c020 1.124078, Tue Sep 11 2007 23:21:40
[XMP-exif]      Color Space                     : Uncalibrated
[XMP-exif]      Exif Version                    : 0221
[XMP-exif]      Exif Image Width                : 612
[XMP-exif]      Exif Image Height               : 792
[XMP-tiff]      Orientation                     : Horizontal (normal)
[XMP-tiff]      Image Width                     : 612
[XMP-tiff]      Image Height                    : 792
[XMP-tiff]      Photometric Interpretation      : RGB
[XMP-tiff]      Samples Per Pixel               : 3
[XMP-tiff]      X Resolution                    : 72
[XMP-tiff]      Y Resolution                    : 72
[XMP-tiff]      Resolution Unit                 : inches
[XMP-tiff]      Bits Per Sample                 : [8,8,8]
[XMP-xmp]       Metadata Date                   : 2011:07:12 11:19:09-04:00
[XMP-crs]       Already Applied                 : True
[XMP-photoshop] Color Mode                      : RGB
[XMP-photoshop] ICC Profile Name                :
[XMP-photoshop] Legacy IPTC Digest              : 763CE36211538C758E3B41466F45DB50
[XMP-mwg-kw]    Keyword Info                    : {Hierarchy=[{Children=[{Keyword=IWS}],Keyword=Business_Unit},{Children=[{Keyword=IWS}],Keyword=Business_Unit},{Children=[{Keyword=IWS}],Keyword=Business_Unit}]}
[XMP-lr]        Hierarchical Subject            : [Product_line||401k,Business_Unit||FIIS]
[XMP-dc]        Subject                         : [401k,FIIS]
[IPTC]          Application Record Version      : 2
[IPTC]          Keywords                        : [401k,FIIS]
[Photoshop]     IPTC Digest                     : 763ce36211538c758e3b41466f45db50
[Composite]     Image Size                      : 612x792"


Thanks for your help. This is a great tool- can't wait to wrap my head around it.

-RL
Title: Re: hierarchicalkeywords Adobe Bridge
Post by: Phil Harvey on July 12, 2011, 12:53:11 PM
Right.

Bridge CS3 appears to be writing XMP-lr:HierarchicalSubject, not XMP-mwg-kw:HierarchicalKeywords.  You should be successful if you write this tag instead from ExifTool.

And it looks like you should also write the child keywords to XMP-dc:Subject:

exiftool -hierarchicalsubject+='Product_line|401k' -hierarchicalsubject+='Business_Unit|FIIS' -subject+=401k -subject+=FIIS ...

- Phil
Title: Re: hierarchicalkeywords Adobe Bridge
Post by: rlindenf on July 12, 2011, 01:13:07 PM
now I'm getting somewhere..

using

exiftool -HierarchicalSubject+="{keyword=Business_Unit,children={keyword=IWS}}" /Users/a351958/Desktop/newTest/FM_001_Header.jpg

yields

[XMP-lr]        Hierarchical Subject            : [|{keyword=Business_Unit|,children={keyword=IWS}}]


while setting the same variable in Bridge yields:

[XMP-lr]        Hierarchical Subject            : [Business_Unit||IWS]
[XMP-dc]        Subject                         : [IWS]
[IPTC]          Application Record Version      : 2
[IPTC]          Keywords                        : IWS


Do I need to be setting IPTC tags as well?

Thanks,

RL
Title: Re: hierarchicalkeywords Adobe Bridge
Post by: Phil Harvey on July 12, 2011, 01:23:42 PM
I think you're getting confused.  HierarchicalSubject is not a structure like HierarchicalKeywords, so you should be writing it as I did in my previous post.

It would be a good idea to keep IPTC and XMP in sync.  You can do this by writing MWG:Keywords, which writes XMP-dc:Subject but also writes IPTC:Keywords and updates the IPTCDigest if IPTC exists.

- Phil
Title: Re: hierarchicalkeywords Adobe Bridge
Post by: rlindenf on July 12, 2011, 01:38:29 PM
success!!

Thanks Phil!

-RL
;D
Title: Re: hierarchicalkeywords Adobe Bridge
Post by: rlindenf on July 17, 2011, 01:41:49 PM
Hi Phil-

I'm almost there. Now I need to be able to generate a list of file names that match metadata search criteria. I don't want to actually move the files, but process other files (these are preview files).

I need to search for the metadata created by this action:
exiftool -hierarchicalsubject+='Module_Header| Header'  -subject+=' Header' -overwrite_original /Users/ralphlindenfeld/Desktop/Fidelity/Fidelity_Work_USB/JOBS/No_Number/Forms/Production_Aids/PDF_Previews/FM_100_Account_Owner.jpg

ideally, I'd like an output showing the file names associated with the those tags:
FM_100_Account_Owner.jpg

I'd like to be able to search for whole terms and parts of terms. As I understand it "=~" is contains, whereas "=" is equals.

I've tried various permutations, including (I'll spare you all the various non-working versions):


exiftool -quick -if $subject=~' Header'   /Users/ralphlindenfeld/Desktop/Fidelity/Fidelity_Work_USB//JOBS/No_Number/Forms/Production_Aids/PDF_Previews/

exiftool -quick -if $hierarchicalsubject=~' Header'   /Users/ralphlindenfeld/Desktop/Fidelity/Fidelity_Work_USB/JOBS/No_Number/Forms/Production_Aids/PDF_Previews/


but the result of the search is:

--> "    1 directories scanned
   14 files failed condition
    0 image files read"


What am I missing here?

Thanks,

RL

Title: Re: hierarchicalkeywords Adobe Bridge
Post by: Phil Harvey on July 18, 2011, 07:13:23 AM
Close, try this:

exiftool -if '$subject=~/ Header/' -filename -S -s DIR

or if you want the directory with the filename, use

exiftool  -if '$subject=~/ Header/' -p '$directory/$filename' DIR

- Phil
Title: Re: hierarchicalkeywords Adobe Bridge
Post by: rlindenf on July 26, 2011, 05:17:26 PM
Phil-

That works, but only for some of the tags. For starters, here's the struct. of the current test file:



[ExifTool]      ExifTool Version Number         : 8.60
[System]        File Name                       : 3.pdf
[System]        Directory                       : /Users/Shared/automation/JOBS/No_Number/Forms/Production_Aids/PDF_Previews
[System]        File Size                       : 35 kB
[System]        File Modification Date/Time     : 2011:07:21 19:46:45-04:00
[System]        File Permissions                : rw-r--r--
[File]          File Type                       : PDF
[File]          MIME Type                       : application/pdf
[PDF]           PDF Version                     : 1.4
[PDF]           Linearized                      : No
[PDF]           Page Count                      : 1
[PDF]           Create Date                     : 2011:07:21 19:26:33-04:00
[PDF]           Creator                         : Adobe InDesign CS3 (5.0.4)
[PDF]           Producer                        : Adobe PDF Library 8.0
[PDF]           Modify Date                     : 2011:07:21 19:26:33-04:00
[PDF]           Trapped                         : False
[PDF]           Subject                         :  Instructions
[XMP-x]         XMP Toolkit                     : Image::ExifTool 8.60
[XMP-dc]        Format                          : application/pdf
[XMP-dc]        Subject                         : [| Instructions,checkedIn]
[XMP-lr]        Hierarchical Subject            : [Module_Header|| Instructions,Status||checkedIn]
[XMP-pdf]       Producer                        : Adobe PDF Library 8.0
[XMP-pdf]       Trapped                         : False
[XMP-xmp]       Create Date                     : 2011:07:21 19:26:33-04:00
[XMP-xmp]       Creator Tool                    : Adobe InDesign CS3 (5.0.4)
[XMP-xmp]       Metadata Date                   : 2011:07:21 19:26:33-04:00
[XMP-xmp]       Modify Date                     : 2011:07:21 19:26:33-04:00
[XMP-xmp]       Thumbnails                      : [{Format=JPEG,Height=256,Image=(Binary data 5319 bytes|, use -b option to extract),Width=256}]
[XMP-xmpMM]     Document ID                     : adobe:docid:indd:ab6f460b-b561-11e0-9e38-a18d48f4126c
[XMP-xmpMM]     Instance ID                     : uuid:aedfdff3-340f-a545-8155-4a2eb205c50a
[XMP-xmpMM]     Rendition Class                 : proof:pdf


running:

exiftool -if '$subject=~/Instructions/' -filename -S -s /Users/Shared/automation/JOBS/No_Number/Forms/Production_Aids/PDF_Previews


yields:

"======== /Users/Shared/automation/JOBS/No_Number/Forms/Production_Aids/PDF_Previews/3.pdf
3.pdf
    1 directories scanned
   11 files failed condition
    1 image files read"


but:

exiftool -if '$subject=~/checkedIn/' -filename -S -s /Users/Shared/automation/JOBS/No_Number/Forms/Production_Aids/PDF_Previews


yields:

    1 directories scanned
   12 files failed condition
    0 image files read


I think I may be actually pulling the [PDF] subject rather than the [XMP-dc] subject. Further, I'd really like to point to the  [XMP-lr] Hierarchical Subject data, on a per subject basis (Module_Header, Status), as that would allow me to not have to post-process the string, or worry about what order it's been created in.

Your answer may also help me with my next problem: returning specific Hierarchical Subject data of a given file.  :-\

Thanks,

Ralph
Title: Re: hierarchicalkeywords Adobe Bridge
Post by: Phil Harvey on July 27, 2011, 07:18:50 AM
Hi Ralph,

There are 2 Subject tags in your file.  Use '$xmp:subject' to get the one you want.  The PDF Subject doesn't contain checkedIn.  Tag names without a group prefix in -if statements will access the same tag as when duplicates are suppressed in the exiftool output.

- Phil