Cascade metadata from RAW to Main version

Post Reply
Mikki
Posts: 112
Joined: 08 May 05 8:59
Location: Denmark

Cascade metadata from RAW to Main version

Post by Mikki »

Hi all.

Is there an easy way (build in functionality or batch job) to have a pile (about 350) version stacks processed with:
a) The RAW file gets assigned a specific place holder
b) All metadata of the RAW file gets cascaded to the JPG (main version) of each version stack

I’ve tested the script “Cascade Meta to Full Version Set for Photo Supreme” (http://repository.idimager.com/cgi-bin/ ... f46f80a8ba). This script works from the assumption that the main version is the file holding the meta data to be cascaded to the full version stack – I do not have my RAW files defined as the mail version.

In fact it would be highly beneficiary to have this cascade option available during the version building process.

Kind regards
Mikki
Last edited by Mikki on 22 Jun 14 14:41, edited 1 time in total.
DirkS
moderator
Posts: 284
Joined: 25 May 08 13:28
Location: Essex, UK

Re: Cascade metadata from RAW to Main version

Post by DirkS »

Mikki,

Unless I'm missing something I would say that the script does exactly what you want: it cascades metadata from the main (not raw!) to other versions.

Gr.
Dirk.
Problems searching the forum? Try Google Site Search by adding 'site:forum.idimager.com' to a standard Google search.
Mikki
Posts: 112
Joined: 08 May 05 8:59
Location: Denmark

Re: Cascade metadata from RAW to Main version

Post by Mikki »

Hi Dirk.

I might have been a bit unclear in my posting above.
In my workflow I complete all metadata work (assign labels, adding descriptions, geo tagging etc.) on the RAW files before any files are converted.
When establishing the version structure the JPG is stored as the main version (at that is the place holder that pr. default is displayed. Thus I need to cascade all metadata from the RAW file to the Main version (and all other versions in the stack for that matter).

The script I found is built to cascade metadata from the *Main version* to the other members of the version stack.

Kind regards
Mikki
DirkS
moderator
Posts: 284
Joined: 25 May 08 13:28
Location: Essex, UK

Re: Cascade metadata from RAW to Main version

Post by DirkS »

I might have been a bit unclear in my posting above.
Maybe you should edit point 2 in your original post, because that's where you state that you need to cascade from the jpg/main to the raw and others.

Gr.
Dirk.
Problems searching the forum? Try Google Site Search by adding 'site:forum.idimager.com' to a standard Google search.
Mikki
Posts: 112
Joined: 08 May 05 8:59
Location: Denmark

Re: Cascade metadata from RAW to Main version

Post by Mikki »

Thanks for pointing out that central point in the posting, Dirk. That's corrected now.
Mikki
Posts: 112
Joined: 08 May 05 8:59
Location: Denmark

Re: Cascade metadata from RAW to Main version

Post by Mikki »

Anybody with a good suggestion on how to conduct the following on several hundreds of version stacks:
a) The RAW file gets assigned a specific place holder
b) All metadata of the RAW file (no place holder) gets cascaded to the JPG (main version) of each version stack

Kind regards
Mikki
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: Cascade metadata from RAW to Main version

Post by Hert »

Mikki,

You can use the script below; make sure that you first configure the script by setting the appropriate values for the top constants.

Code: Select all

// make your settings here first
const
  cExtension = '.CR2';
  cPlaceHolderName = 'e-mail';
  cRemoveExistingPlaceholders = 1;  // 1 = yes, 0 = no
  cCascadeAfterwards = 1;  // 1 = yes, 0 = no

var
  i: Integer;
  AImage: TImageItem;
  AMain, AVersion: TCatalogItem;
  APh: TCatalogPlaceHolder;
  AProgress: TxomProgress;
begin
  APh := TCatalogPlaceHolder.Create(nil);
  if Catalog.EnumPlaceHolderByName(cPlaceHolderName, APh, False) then
  begin
    AProgress := TxomProgress.Create(nil);
    AProgress.Caption := 'Define place holder';
    AProgress.Max := Selected.Count;
    AProgress.CanCancel := True;
    for i := 0 to Selected.Count - 1 do
    begin
      AProgress.Pos := i + 1;
      if AProgress.Cancel then
        break;
      AImage := Selected.Items[i];
      if AImage._IsVersion and
         WideSameText(WideExtractFileExt(AImage.FileName), cExtension)
      then
      begin
        AMain := TCatalogItem.Create(nil);
        AVersion := TCatalogItem.Create(nil);
        if Catalog.FindMainVersionForImage(AImage, AMain) and
           Catalog.FindImageCombined(AImage, AVersion, False, vptNone)
        then
        begin
          // this version should now be stored to the specified placeholder
          if cRemoveExistingPlaceholders = 1 then
            Catalog.RemovePlaceHoldersOfVersion(AVersion);
          Catalog.AssignPlaceHolderToVersionInMain(AMain, AVersion, APh);
          if cCascadeAfterwards then
            Catalog.CascadeMetaForItem(AVersion, False);
        end;
        AVersion.Free;
        AMain.Free;
      end;
    end;
    AProgress.Free;
  end
  else
    Say ('Place holder with name ' + cPlaceHolderName + ' doesn''t exist');
end;
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
Mikki
Posts: 112
Joined: 08 May 05 8:59
Location: Denmark

Re: Cascade metadata from RAW to Main version

Post by Mikki »

Hi Hert.

Thanks for building the script! I need a bit of advice regarding the top part whcih is to be configureds:
* I assume this is identifying the "source" to copy MetaData from: cExtension = '.CR2'; Is that a correct assumprion?

* Is this the target of the cascade or? What do I write here, if I need the MetaData to be cascaded to all versions of the version set: cPlaceHolderName = 'e-mail';

* What it the effect of removing existing placeholders? cRemoveExistingPlaceholders = 1; // 1 = yes, 0 = no

*And this: cCascadeAfterwards = 1; // 1 = yes, 0 = no? I do want the script to cascade the data, can it do more than that?

Kind regards
Mikki
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: Cascade metadata from RAW to Main version

Post by Hert »

Mikki wrote:* I assume this is identifying the "source" to copy MetaData from: cExtension = '.CR2'; Is that a correct assumprion?
cExtension is the extension that you want to store to the specified Placeholder. If you enable cCascadeAfterwards then it will also cascade fro that version to the rest of the version set.
* What it the effect of removing existing placeholders? cRemoveExistingPlaceholders = 1; // 1 = yes, 0 = no
If you specify cRemoveExistingPlaceholders then all existing placeholders for the specified cExtension are removed before it is assigned to the specified placeholder.
*And this: cCascadeAfterwards = 1; // 1 = yes, 0 = no? I do want the script to cascade the data, can it do more than that?
More than cascade?

Try it on a test version set to fully understand the different settings.

Hert
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
Mikki
Posts: 112
Joined: 08 May 05 8:59
Location: Denmark

Re: Cascade metadata from RAW to Main version

Post by Mikki »

Hi Hert.

Back from Canada and now on to work with a pile of images... :?
I've now tried the scripet you suggested. The parameters to be set in the top of the scripe I've used:
cExtension = '.CR2';
cPlaceHolderName = 'RAW';
cRemoveExistingPlaceholders = 1; // 1 = yes, 0 = no
cCascadeAfterwards = 1; // 1 = yes, 0 = no


I have defined a place holder named RAW; whcih is the placeholder I want the script to assign the .CR2 file. From this file teh meta data should be copied, and pasted to all version in the version set. It does however not work.
While investigating the issue (hwy the script does not propagate meta data to the other images in the version stack) I noticed, that the version placeholder called RAW is no longer to be seen in Preferences -> Catalog. Could this be the cause for the script not to work?

When manually assigning version place holders, the RAW place holder is availabel...
Version Place Holder named RAW
Version Place Holder named RAW
RAW.jpg (36.6 KiB) Viewed 7414 times
However it's not listed in Preferences:
Missing RAW version place holder
Missing RAW version place holder
PlaceHolders.jpg (92.84 KiB) Viewed 7414 times
Kind regareds
Mikki
Post Reply