import sys, os, glob

# Log File
image_list_file_dir = "/r02/data/images/hist_air_photos/tools/scripts"
image_list_file_name = "full_image_list.txt"
image_list_file_path = os.path.join(image_list_file_dir, image_list_file_name)

# ----- Open Image File -----
try:
    image_list_file = open(image_list_file_path,"w")
except:
    print "Cannot open file: " + image_list_file
    exit(1)

search_path = '/r02/data/images/hist_air_photos/*/*/*/*.jpg'
results = [p for p in glob.glob(search_path) if not glob.fnmatch.fnmatch(p,'*thumb.jpg')] + glob.glob(search_path.replace('.jpg','.tif'))

image_list_file.write('\n'.join(results))
image_list_file.close()
