aboutsummaryrefslogtreecommitdiff
path: root/src/im-sandbox.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-08-09 12:27:06 +0200
committerThomas White <taw@physics.org>2012-08-09 12:27:06 +0200
commit0a5e4738b9799082439286853602b485c4debe76 (patch)
tree0450838d4355318973dbb647580ab253059cf8d4 /src/im-sandbox.c
parent534cb9247a75a176d0dd86f80c3f273a9d208824 (diff)
indexamajig: Make "-e/--image" work again
This got lost somewhere in the speed improvements
Diffstat (limited to 'src/im-sandbox.c')
-rw-r--r--src/im-sandbox.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index c9ad5300..1a344125 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -175,7 +175,7 @@ static void process_image(const struct index_args *iargs,
int config_verbose = iargs->config_verbose;
IndexingMethod *indm = iargs->indm;
struct beam_params *beam = iargs->beam;
- int r, check;
+ int check;
struct hdfile *hdfile;
struct image image;
@@ -193,11 +193,26 @@ static void process_image(const struct index_args *iargs,
hdfile = hdfile_open(image.filename);
if ( hdfile == NULL ) return;
- r = hdfile_set_first_image(hdfile, "/");
- if ( r ) {
- ERROR("Couldn't select first path\n");
- hdfile_close(hdfile);
- return;
+ if ( iargs->element != NULL ) {
+
+ int r;
+ r = hdfile_set_image(hdfile, iargs->element);
+ if ( r ) {
+ ERROR("Couldn't select path '%s'\n", iargs->element);
+ hdfile_close(hdfile);
+ return;
+ }
+
+ } else {
+
+ int r;
+ r = hdfile_set_first_image(hdfile, "/");
+ if ( r ) {
+ ERROR("Couldn't select first path\n");
+ hdfile_close(hdfile);
+ return;
+ }
+
}
check = hdf5_read(hdfile, &image, 1);