You are not logged in.
Is there a way to change the file modification date to the date stored in EXIF?
Offline
Is there a way to change the file modification date to the date stored in EXIF?
Can you confirm if you want the exif date to be applied to the file modification date, or the other way around?
There are ways to do both, but the tools will differ based on your answer.
Offline
A script included below for the Pascal Script rule will read the exif date and apply it to the file modification date.
Be aware: The script will be executed on every Preview operation, as opposed to a Rename operation. This is just how renaming rules work. All successfully processed files will have their names prefixed with a plus sign, which may be useful for validation, but otherwise you can comment out this effect in the script.
var
ExifDateStr: WideString;
ExifDate: TDateTime;
const
TempDateFormat = 'yyyy-mm-dd hh:nn:ss';
begin
ExifDateStr := CalculateMetaTagFormat(FilePath, 'Exif_Date', TempDateFormat);
if Length(ExifDateStr) > 0 then
begin
ExifDate := ScanDateTime(TempDateFormat, ExifDateStr);
if SetFileTimeModified(FilePath, ExifDate) then
FileName := '+' + FileName
else
Error('Failed to set the modified date on file: ' + FilePath);
end;
end.
Alternatively, it should be possible to achieve the same effect with these capable command line tools: ExifTool and Exiv2. There should be some good examples online.
Offline
This works very well, thank you
Offline