aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-11-14 15:29:27 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:39 +0100
commit92c8e54dc695afe1e3be1c2e022492016b12d8ba (patch)
treee447e137d46225239590bdcfb347a54fac2eee90 /src
parent1bad219c3b968142fdeb686bad04b4b706c4368f (diff)
Check that geometry size matches image size
Diffstat (limited to 'src')
-rw-r--r--src/indexamajig.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index e7391bb5..7ce661aa 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -278,6 +278,20 @@ static void process_image(void *pp, int cookie)
}
hdf5_read(hdfile, &image, pargs->static_args.config_satcorr);
+
+ if ( (image.width != image.det->max_fs+1)
+ || (image.height != image.det->max_ss+1) )
+ {
+ ERROR("Image size doesn't match geometry size"
+ " - rejecting image.\n");
+ ERROR("Image size: %i,%i. Geometry size: %i,%i\n",
+ image.width, image.height,
+ image.det->max_fs+1, image.det->max_ss+1);
+ hdfile_close(hdfile);
+ free_detector_geometry(image.det);
+ return;
+ }
+
if ( image.lambda < 0.0 ) {
if ( beam != NULL ) {
ERROR("Using nominal photon enery of %.2f eV\n",