• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Custom data in a Custom File Info Panel

New Here ,
Sep 16, 2016 Sep 16, 2016

Copy link to clipboard

Copied

Hi all. I'm inexpert at scripting but I've been having fun creating a Custom Info Panel in Adobe Bridge thanks to this thread:Custom Info Panel as Bridge MetaData Panel​. This is for a project to restore some harmony to a rather large photo collection. At some point in the past an external contractor got around some problem (now forgotten) by creating a custom metadata schema to track some specific needs of the client. Going forward we'll be keeping everything within the bounds of IPTC standard fields, but for the clean up it would be really helpful to display the custom fields alongside IPTC fields in the Info Panel. When I look at the XMP list of raw data for an existing image I can see the relevant fields listed like this:

        <CR_1_:BBCCompliance>False</CR_1_:BBCCompliance>

         <CR_1_:Campaign>1985-2003</CR_1_:Campaign>

         <CR_1_:Exclusive>False</CR_1_:Exclusive>

I managed to get a custom info panel working in Bridge CC6 (Mac) with the following file:

<?xml version='1.0' encoding='UTF-8'?>

<xmp_definitions>

  <xmp_schema prefix='mypanel' namespace='http://ns.adobe.com/mypanel/' label='$$$/my/FileInfoLib/Panels/Name=mypanel'>

         <!-- simple properties -->

        <xmp_property name="Text" category="external" label="$$$/Custom/Panel/Document Title=Property 1 Name:" type="text"/>

        <xmp_property name="Text2" category="external" label="$$$/Custom/Panel/Credit=Property 2 Name:" type="text"/>

        <xmp_property name="Bool1" category='external' label="$$$/Custom/Property/BooleanInput_Label=Check Box Input:" type='boolean'/>

        <xmp_property name="Bool2" category='external' label="$$$/Custom/Property/BooleanInput_Label2=Check Box Input2:" type='boolean'/>

  </xmp_schema>

</xmp_definitions>

But from that point on I have been unable to adapt it to show the custom data. Where I'm struggling is that I don't know how to address those fields in the custom info panel's xmp file. OR Maybe I'm completely misunderstanding the deal here. Perhaps by "custom file info panel" this only allows the creation of NEW custom fields, not pull data from old ones.

Either way I'd be enormously grateful for a pointer or two from somebody who really understands this stuff. If I'm barking up the wrong tree it would be good to know. And if there's a better tree I'd love to know what that is. My basic need is to pull the old custom metadata info up front while I work on cleaning up the files in Bridge. Or writing or adapting a script that would write that data back into standard fields supported by Bridge that I can work with.

Hope this makes sense

Mick

TOPICS
Scripting

Views

2.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2016 Sep 18, 2016

Copy link to clipboard

Copied

Or writing or adapting a script that would write that data back into standard fields supported by Bridge that I can work with.

If you would like to do this fast, then I would recommend using ExifTool, I can help you through the learning curve if needed, I nave a little experience with using this free but powerful CLI tool. Generally a single line of code in ExifTool can achieve the same results as hundreds of lines of script in Bridge.

Can you supply a file sharing link to download a copy of one of the images in question? It only needs to be a 1 pixel square, this is all about the metadata.

BBCCompliance = Mapped to which IPTC Core/Extension Field?

Campaign = Mapped to which IPTC Core/Extension Field?

Exclusive = Mapped to which IPTC Core/Extension Field?

Do you wish to remove the custom values from the original custom metadata entries, remove the entire custom metadata entries and values or simply leave them as is?

Will you be performing these tasks on a Mac or Windows OS?

Otherwise if you wish to do this with Bridge Scripting, I would recommend posting your question to the following site if you don’t get a satisfactory result at this site.

https://www.ps-scripts.com/viewforum.php?f=72

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 20, 2016 Sep 20, 2016

Copy link to clipboard

Copied

How very kind of you to offer to help Stephen. Shortly after posting my question I convinced myself that getting to grips with the Exiftool was likely to be a more productive way forward. So I went ahead and installed that as well as the pyExifToolGui which allows me to see what's going on. I'm similarly inexpert with CLI but have run a couple of simple Exif commands which seemed to work fine but I still could really use some advice on how to handle those custom fields.

In answer to your questions:

  • Here is a sample image which has a total of 6 custom xmp fields embedded. https://db.tt/MXqJo8bE (Note: I don't know if it makes a difference to the copying or moving of field data, but the fields are a mixture of free text, combobox  and checkbox on our present system. )
  • As to mapping to IPTC fields, the answer is complex: over the years some of the information in these custom fields for some images has been duplicated or superceded in IPTC (or DC fields that write to IPTC, right?). In others, particularly in the earliest images, that custom data is the only identifying information we have so it's crucial that it is not lost. That's particularly true of the Description field.

All in all a mess I know. But my plan, such as it is, is to move cautiously forward on step at a time:

  • identify images whose IPTC/DC Description fields are empty and COPY in data from the custom Description field where it exists
  • ditto with the Custom Tags field
  • For the other custom fields my thought was to write to them to standard fields that we never use so that I can see them while editing in Bridge. AND in order to preserve that data for when we finally make the transition to a new DAM system somewhere down the road. But maybe that's one for the DAM supplier to figure. The main purpose here is to make my clean-up job a little easier
  • Beyond that it might be helpful to know how to APPEND data to a field and perhaps add some boilerplate text to a field.

Presuming that makes sense, if you are able to show me how to construct a CLI command or two based on what's here I'd be really grateful. Hopefully that will get me rolling up that curve so I can figure out other options as we roll forward. thx again

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 20, 2016 Sep 20, 2016

Copy link to clipboard

Copied

Oh, and I'm on a Mac.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 20, 2016 Sep 20, 2016

Copy link to clipboard

Copied

Mick, can you post a link to a JPEG image rather than an .xmp sidecar file? You can crop down the image if you wish.

To start, let’s compare the simplest ExifTool command:

exiftool 91MR_100726_0004.xmp

BBC Compliance : False

Campaign       : 1985-2003

Description    : Teacher Relief Packs from 1991

Exclusive      : False

Media Type     : Photo

Model Shot     : False

CR Tags        : Teacher Relief, Book, Education, Serious comiitment, red nose day, comic relief, 1991

Now let’s try a more useful variation, which lists the actual tag groups and names that ExifTool would use in various commands:

exiftool -a -G1 -s 91MR_100726_0004.xmp

[XMP-CR]  BBCCompliance : False

[XMP-CR]  Campaign      : 1985-2003

[XMP-CR]  Description   : Teacher Relief Packs from 1991

[XMP-CR]  Exclusive     : False

[XMP-CR]  MediaType     : Photo

[XMP-CR]  ModelShot     : False

[XMP-CR]  CRTags        : Teacher Relief, Book, Education, Serious comiitment, red nose day, comic relief, 1991

As you have custom/user defined source tags, this adds a little complexity…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 20, 2016 Sep 20, 2016

Copy link to clipboard

Copied

Thanks Stephen, I'll take a closer look at this when I have little more time--hopefully tomorrow. Meantime, that link should take you to both the image and the xmp file. When I click it I see the image in thumbnail which is itself a link to the main image with a link to the xmp below. Let me know if that's not the case for you.

As for custom-made complexity—yes that would sum it up from my end. My aim is to steer back to simplicity cos this collection is big but nothing fancy.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2016 Sep 21, 2016

Copy link to clipboard

Copied

Hi Mick – OK, I worked out the DropBox image interface, my mistake!

By complexity, I meant that “out of the box” ExifTool does not know how to write custom tags (it can only list them by default). So, a “configuration file” that has been setup for the custom tags has to be installed or referenced in the CLI code.

Work on backup copies of your files while testing!

First, the config code (saved as a text file named test.config😞

%Image::ExifTool::UserDefined = (

    'Image::ExifTool::XMP::Main' => {

        xxx => {

            SubDirectory => {

                TagTable => 'Image::ExifTool::UserDefined::xxx',

            },

        },

    },

);

%Image::ExifTool::UserDefined::xxx = (

    GROUPS       => { 0 => 'XMP', 1 => 'XMP-xxx', 2 => 'Image' },

    NAMESPACE    => { 'xxx' => 'http://ns.myname.com/xxx/1.0/' },

    WRITABLE     => 'string',

    XMP-CR_1_:BBCCompliance => { },

);

1;  #end

Notice how line 16 uses one of the custom tags from your example file?

This config file can either be installed or simply referenced in a CLI code. I have used the later so as not to have to install the config file.

The  exiftool  -a -G1 -s  command lists the tag group and name as:

[XMP-CR_1_] BBCCompliance

Which is expressed as the following when used in an ExifTool CLI code (remove the square brackets and add a colon where the space was):

XMP-CR_1_:BBCCompliance

Finally the actual ExifTool CLI code follows (I have applied faux syntax highlighting to help visually break up the code):

exiftool -config '/Users/stephenmarsh/Desktop/test.config' '-Subject<XMP-CR_1_:BBCCompliance' '/Users/stephenmarsh/Desktop/91MR_100726_0004-2.jpg'

This code points to a configuration file titled “test.config” which is located on the desktop of the current logged in user. The DC:Subject (Keyword) metadata field is being populated (overwritten) with the custom XMP-CR_1_:BBCCompliance entry (True or False).

This is just an example, you would probably wish to map to a different standard IPTC/DC field.

Inspecting in Bridge and ExifTool shows that the resulting subject/keyword field is correctly populated (despite an error/warning is reported so I must have a minor syntax error in my CLI code – I am only an ExifTool newb too).

This is just a “training wheels” exercise used as an example, so I hope that you can follow along (this is not an easy task to introduce ExifTool)…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 21, 2016 Sep 21, 2016

Copy link to clipboard

Copied

That is so cool. I can't say I understand it all but I followed your very precise instructions Stephen and it worked just like you said. If you're a Exif newbie, I'm not sure what that makes me! I'll put some time into this in the next few days and try and construct a few more working examples. I rather expect there will be more questions to come but that's a huge helping hand. Thank you so much Stephen.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2016 Sep 21, 2016

Copy link to clipboard

Copied

I have only been using ExifTool for six months or so, it is a very deep and powerful piece of software (I am continually amazed at what it can do).

I am all for doing these things in Bridge, however I don’t know scripting so I have found that ExifTool can achieve what is needed without having to get help from others.

Feel free to post back if you get stuck.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2016 Sep 21, 2016

Copy link to clipboard

Copied

Part of your previous reply mentioned appending metadata, rather than overwriting.

The following snippet of code overwrites the subject (keywords) with the custom tag value:

'-Subject<XMP-CR_1_:BBCCompliance'

While this code appends (simply add a plus + character):

'-Subject+<XMP-CR_1_:BBCCompliance'

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Brilliant! I can really use that.

Bridge is great for most of the things I want to do with this project but I keep bumping into frustrating limitations such as, for example, finding all the images whose Credit Line is empty. That field simply doesn't appear in the Find criteria and even if it did I don't know how to search for an empty field. Common search operators like * or = or ? don't seem to work. Whether that's a limitation of the software or the structure or location of that metadata, I don't know. But maybe Exiftool can ride to the rescue again here.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Yes, it is frustrating when one hits a limitation in Bridge. This is of course when scripting comes into play – which is why I am forced to use ExifTool…

In your example, it is “easy enough” to search for files that meet a certain condition, such as having a credit entry:

exiftool -if '$credit =~ /./' -credit '/Users/stephenmarsh/Desktop/exiftool-test/' -r

This command will scan a desktop folder titled “exiftool-test” (and -r “recursively" scan all subfolders/files within that target folder). It is looking for any value in the credit metadata field. It is great test to see if something matches a condition, however it is probably not much use beyond that point.

Perhaps a better example would be to create a comma separated value text file on the desktop of the logged in user. The CSV would contain the credit field values, listing the filename/path of the images that were recursively scanned in the target folder “exiftool-test” located on the desktop of the logged in user. This can then be opened into a spreadsheet program and a filter or sorting can then be placed on the credit column values to isolate the files with a missing entry:

exiftool -credit -csv '/Users/stephenmarsh/Desktop/exiftool-test' > '/Users/stephenmarsh/Desktop/exiftool-keyword-dump.csv' -r

credit.png

There are of course other possibilities, it all depends on what you wish to do!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Mick, you will probably find the following possibility better from a workflow perspective, as it will then leverage Adobe Bridge!

Let’s add some conditional processing with the previous -if command example. This will add an Adobe Bridge Label of “Review” to the images that don’t have a value in the IPTC:Credit field (a negative condition, if you like, as opposed to the eariler positive conditional match).

Remember, work on duped test files while you practice, even more so as I am now introducing an overwrite command which does not create a backup (ExifTool duplicates the original file and renames it by default)…

exiftool -r -overwrite_original_in_place -if 'not defined $credit' -label='Review' '/Users/stephenmarsh/Desktop/exiftool-test/'

Notice how the recursive -r command is now at the start, rather than the end of the CLI code? Generally speaking, order does not matter (unless it does matter!).

Now you can use Bridge’s Find command and/or Smart Collections to isolate the files that don’t have a Credit entry by searching for the Label=Review (this obviously only works if no other images are labelled review).

Or instead of using a label, you could use a Rating of Reject and search/filter for rejected ratings:

exiftool -r -overwrite_original_in_place -if 'not defined $credit' -Rating='-1' '/Users/stephenmarsh/Desktop/exiftool-test/'

P.S. Depending on your metadata, this variation where “defined” has been removed may or may not be more appropriate (depends if you get false positives or not I guess):

-if 'not $credit'

NOTE: Keep in mind that you may need to keep purging the Bridge cache for the current folder if Bridge is left open when you are updating the metadata from ExifTool.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 10, 2016 Nov 10, 2016

Copy link to clipboard

Copied

Hi Stephen,

Just returning to this project after other distractions. I'm happy to report that the I managed to get the above Terminal command to work perfectly on a backup of a large folder on my desktop but I'm not able to do the same on the original which is on a local server. When I use the same command above with the following address in Terminal

'/Volumes/RND\ Photos/1985-2003\ Archive/1991/1991_CELEBRITY’

I just get a chevron returned which, I think, suggests Terminal is awaiting a further command.

I can navigate and get the directory listing at that address so not sure what the problem is. Grateful for any thoughts.

Mick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 10, 2016 Nov 10, 2016

Copy link to clipboard

Copied

Hi Mick,

I am sure that this was only the forum software changing your text input, however notice that your path has a straight opening quote and a curly closing quote? They both need to be straight, not curly.

__________

Moving on, I am not sure if the following matters or not, however it can’t hurt to test…

Looking at your path, it appears that you have dragged the top level folder into Terminal.app to get the path. Here is a sample from my external drive:

/Volumes/2TB-DRIVE/Top\ Level\ Folder\ Test

Try without quotes if you are dragging to terminal to get the path…

__________

However if the same folder is dragged into TextEdit.app (plain text mode, not in rich text mode) or if you use the Finder’s Get Info command, the result is:

/Volumes/2TB-DRIVE/Top Level Folder Test

However for a command line, if the path has word spaces, one has to wrap the path in single straight quotes so that the directory path is not confused with an actual command:

'/Volumes/2TB-DRIVE/Top Level Folder Test'

You could also try a single file rather than an entire top level folder, or just try a smaller folder under the top level to see if this changes anything. Another less than ideal option could be to copy to your local drive, process, then copy back to network drive again.

Another option is to try a simple command:

exiftool -r /Volumes/RND\ Photos/1985-2003\ Archive/1991/1991_CELEBRITY

or

exiftool -r '/Volumes/RND/Photos/1985-2003/Archive/1991/1991_CELEBRITY'

I am guessing that this one is invalid:

exiftool -r '/Volumes/RND\ Photos/1985-2003\ Archive/1991/1991_CELEBRITY'

As the Adobe forums are not the best place to deeply discuss or troubleshoot third party tools, you may get better replies at the ExifTool forum:

ExifTool Forum

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 16, 2016 Nov 16, 2016

Copy link to clipboard

Copied

LATEST

Hi Stephen. Thanks again for riding to the rescue. Those pesky curly quotes again! You correctly guessed that the filepath was generated by dragging the folder to Terminal which generates (I think) a Unix format path, i.e. with "\<space>" denoting spaces in folder and filenames. But ultimately I think it was the quotemarks that made the difference. In the end I used the path as above but without quotemarks and ensured straight quotes for the others in there and that did the trick. Hopefully I'll not have to bother this forum with rookie problem--for a while at least. I am again much obliged to you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines