Date is converted to YYYY\MM\DD string
This commit is contained in:
+3
-1
@@ -23,7 +23,9 @@ def get_exif_date(file_path):
|
||||
date_string = result.stdout.strip()
|
||||
if date_string:
|
||||
# Clean up potential trailing units or extra metadata lines
|
||||
return date_string.split('\n')[0].strip()
|
||||
cleaned_date = date_string.split('\n')[0].strip()
|
||||
# Replace '-' with '\' as requested
|
||||
return cleaned_date.replace('-', '\\')
|
||||
return "Date not found in metadata."
|
||||
except subprocess.CalledProcessError as e:
|
||||
# This handles cases where exiftool fails (e.g., corrupted file)
|
||||
|
||||
Reference in New Issue
Block a user