IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29026


Ignore:
Timestamp:
Aug 23, 2010, 4:11:43 PM (16 years ago)
Author:
bills
Message:

in MatchImage() we can't depend on the location of an image in the images table is imageID - 1. But it usually is, so check. If it isn't found do the search as before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/ImageSelection.c

    r28958 r29026  
    4747Image *MatchImage (unsigned int time, short int source, unsigned int imageID) {
    4848
    49   int m;
     49  int m = -1;
    5050
    5151  if ((imageID != 0) && (imageID < Nimage)) {
    52     m = (int) imageID - 1;
    53   } else {
     52    // imageID is in range for the array of images. If the table is still in order and
     53    // no images have been deleted the index of the image we are looking for will be imageID - 1
     54    // If this is the case, we have it. Otherwise we'll have to go search for it below
     55    int guess = (int) imageID - 1;
     56    if (image[guess].imageID == imageID) {
     57        m = guess;
     58    }
     59  }
     60  if (m == -1) {
    5461    m = match_image_subset (image, subset, Nsubset, time, source);
    5562  }
Note: See TracChangeset for help on using the changeset viewer.