original_docstring: Check if timestamps are ordered by looking for negative diferences between images
docstring: Check if timestamps are ordered by looking for negative diferences between images
docstring_tokens: Check if timestamps are ordered by looking for negative diferences between images
code: def check_time_order(dict_exif_in, autofix):
      """Check if timestamps are ordered by looking for negative diferences between images"""
      b_error_detected = False
  
      if len(dict_exif_in['timestampMs']) > 1:
          for i in range(1, len(dict_exif_in['timestampMs'])):
              date_diff = dict_exif_in['timestampMs'][i]-dict_exif_in['timestampMs'][i-1]
              if date_diff.total_seconds() < 0:
                  if autofix:
                      #Simple fix, set time to that of previous picture
                      dict_exif_in['timestampMs'][i-1] = dict_exif_in['timestampMs'][i]
                      dict_exif_in['timestampMs_localtime'][i-1] = dict_exif_in['timestampMs_localtime'][i]
                  else:
                      print("File:", dict_exif_in['filename'][i - 1],
                            "Exif time", dict_exif_in['timestampMs_localtime'][i-1])
                      b_error_detected = True
  
      if b_error_detected:
          print("\nERROR: Timestamps not chronologically ordered.")
          print("Please check EXIF timestamp for above images")
          print("SOLUTIONS:")
          print("    - Modify manually the auxiliar/exif.csv or the image exif")
          print("    - Set autofix to True in extractExif.load_exif_data()")
          exit(-5)
code_tokens: def check_time_order ( dict_exif_in , autofix ) : b_error_detected = False if len ( dict_exif_in [ 'timestampMs' ] ) > 1 : for i in range ( 1 , len ( dict_exif_in [ 'timestampMs' ] ) ) : date_diff = dict_exif_in [ 'timestampMs' ] [ i ] - dict_exif_in [ 'timestampMs' ] [ i - 1 ] if date_diff . total_seconds ( ) < 0 : if autofix : dict_exif_in [ 'timestampMs' ] [ i - 1 ] = dict_exif_in [ 'timestampMs' ] [ i ] dict_exif_in [ 'timestampMs_localtime' ] [ i - 1 ] = dict_exif_in [ 'timestampMs_localtime' ] [ i ] else : print ( "File:" , dict_exif_in [ 'filename' ] [ i - 1 ] , "Exif time" , dict_exif_in [ 'timestampMs_localtime' ] [ i - 1 ] ) b_error_detected = True if b_error_detected : print ( "\nERROR: Timestamps not chronologically ordered." ) print ( "Please check EXIF timestamp for above images" ) print ( "SOLUTIONS:" ) print ( "    - Modify manually the auxiliar/exif.csv or the image exif" ) print ( "    - Set autofix to True in extractExif.load_exif_data()" ) exit ( - 5 )
short_docstring: Check if timestamps are ordered by looking for negative diferences between images
short_docstring_tokens: Check if timestamps are ordered by looking for negative diferences between images
comment: """Check if timestamps are ordered by looking for negative diferences between images"""$SEP$#Simple fix, set time to that of previous picture
  