def geotag_from_exif(process_file_list,
                     import_path,
                     offset_time=0.0,
                     offset_angle=0.0,
                     verbose=False):
    if offset_time == 0:
        for image in tqdm(process_file_list, desc="Extracting gps data from image EXIF"):
            geotag_properties = get_geotag_properties_from_exif(
                image, offset_angle, verbose)

            create_and_log_process(image,
                                   "geotag_process",
                                   "success",
                                   geotag_properties,
                                   verbose)
    else:
        try:
            geotag_source_path = gpx_from_exif(
                process_file_list, import_path, verbose)
            if not geotag_source_path or not os.path.isfile(geotag_source_path):
                raise Exception
        except Exception as e:
            print_error(
                "Error, failed extracting data from exif due to {}, exiting...".format(e))
            sys.exit(1)

        geotag_from_gps_trace(process_file_list,
                              "gpx",
                              geotag_source_path,
                              offset_time,
                              offset_angle,
                              verbose=verbose)
def geotag_from_exif(process_file_list,
                     import_path,
                     offset_time=0.0,
                     offset_angle=0.0,
                     verbose=False):
    if offset_time == 0:
        for image in tqdm(process_file_list, desc="Extracting gps data from image EXIF"):
            geotag_properties = get_geotag_properties_from_exif(
                image, offset_angle, verbose)

            create_and_log_process(image,
                                   "geotag_process",
                                   "success",
                                   geotag_properties,
                                   verbose)
    else:
        try:
            geotag_source_path = gpx_from_exif(
                process_file_list, import_path, verbose)
            if not geotag_source_path or not os.path.isfile(geotag_source_path):
                raise Exception
        except Exception as e:
            print_error(
                "Error, failed extracting data from exif due to {}, exiting...".format(e))
            sys.exit(1)

        geotag_from_gps_trace(process_file_list,
                              "gpx",
                              geotag_source_path,
                              offset_time,
                              offset_angle,
                              verbose=verbose)