IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35243


Ignore:
Timestamp:
Mar 6, 2013, 11:25:12 AM (13 years ago)
Author:
eugene
Message:

skip repair if no duplicate images are found

Location:
trunk/Ohana/src/delstar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/delstar/include/delstar.h

    r35237 r35243  
    120120int delete_duplicate_image_measures_catalog (Catalog *catalog, IndexArray *imageID);
    121121
    122 IndexArray *find_duplicates (Image *image, off_t Nimage);
     122IndexArray *find_duplicates (Image *image, off_t Nimage, off_t *Nduplicates);
    123123IndexArray *make_index_array (Image *image, off_t Nimage, int mode);
    124124
  • trunk/Ohana/src/delstar/src/delete_duplicate_images.c

    r35237 r35243  
    1717  }
    1818
    19   IndexArray *imageID = find_duplicates (image, Nimage);
     19  off_t Nduplicates = 0;
     20  IndexArray *imageID = find_duplicates (image, Nimage, &Nduplicates);
     21
     22  if (Nduplicates == 0) {
     23    fprintf (stderr, "no duplicate images in this database, exiting\n");
     24    exit (0);
     25  }
     26
     27  fprintf (stderr, "deleting measures for "OFF_T_FMT" duplicate images in this database\n", Nduplicates);
    2028
    2129  if (!IMAGE_ONLY) {
     
    397405}
    398406
    399 IndexArray *find_duplicates (Image *image, off_t Nimage) {
     407IndexArray *find_duplicates (Image *image, off_t Nimage, off_t *Nduplicates) {
    400408
    401409  off_t i, *Ndelete;
     
    432440
    433441  IndexArray *imageID = make_index_array (image, Nimage, IMAGE_ID);
     442
     443  off_t Ndup = 0;
    434444
    435445  // set imageID->value to TRUE for images we want to delete
     
    447457    imageID->value[Ni] = TRUE;
    448458    Ndelete[Nx] ++;
     459
     460    Ndup ++;
    449461
    450462    // mark the parentID for deletion as well..
     
    469481  free (extID);
    470482
     483  *Nduplicates = Ndup;
     484
    471485  return imageID;;
    472486}
Note: See TracChangeset for help on using the changeset viewer.