Index: trunk/ippTools/src/chiptoolConfig.c
===================================================================
--- trunk/ippTools/src/chiptoolConfig.c	(revision 6210)
+++ trunk/ippTools/src/chiptoolConfig.c	(revision 6214)
@@ -116,4 +116,47 @@
     EMPTY_TO_NULL_STRING(config->url);
 
+    psMetadata *where = psMetadataAlloc();
+
+    if (config->camera_name != NULL) {
+        if (!psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==",
+            config->camera_name)) {
+            psError(PS_ERR_UNKNOWN, false, "failed to add item camera");
+            psFree(where);
+            return NULL;
+        }
+    }
+    if (config->filter != NULL) {
+        psMetadataAddStr(where, PS_LIST_TAIL, "filter", 0, "==",
+            config->filter);
+    }
+    if (config->exp_id != NULL) {
+        psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==",
+            config->exp_id);
+    }
+    if (config->class != NULL) {
+        psMetadataAddStr(where, PS_LIST_TAIL, "class", 0, "==",
+            config->class);
+    }
+    if (config->class_id != NULL) {
+        psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==",
+             config->class_id);
+    }
+
+    /*
+    // psMetadataConfig does not support times yet
+    if (!psTimeIsZero(config->start) && !psTimeIsZero(config->stop)) {
+        psMetadataAddTime (where, PS_LIST_TAIL, "TIME_START", 0, "<", config->stop);
+        psMetadataAddTime (where, PS_LIST_TAIL, "TIME_STOP", 0, ">", config->start);
+    }
+    */
+
+    if (where->list->n < 1) {
+        psFree(where);
+        where = NULL;
+    }
+
+    config->where = where;
+
+
     // add the input and output images to the arguments list
     //psMetadataAddStr (config->arguments, PS_LIST_TAIL, "-output", 0, "Name of the output image", argv[1]);
