#1 2025-02-20 09:14

DAWO
Member
Registered: 2025-02-20
Posts: 1

ReNamer does not insert EXIF_Date when using heic-files

When adding as the first rule to insert EXIF_Date as a first rule and replacing the current file name and skipping extension, nothing is inserted if I supply a photo in the heic-file format. I have checked the file and verified that there is date metadata in the photo file.

What am I missing?

Offline

#2 2025-02-21 00:41

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,514

Re: ReNamer does not insert EXIF_Date when using heic-files

There is no built-in support for HEIC / HEIF image file format yet, but you can use a 3rd party tool such as ExifTool in combination with ReNamer to extract meta tags and then use them for renaming files.

See this example script:
https://www.den4b.com/wiki/ReNamer:Scripts:ExifTool

Offline

#3 2026-01-06 06:55

skiwi
Member
Registered: 2009-06-15
Posts: 29

Re: ReNamer does not insert EXIF_Date when using heic-files

Thanks for the script, I hope that the Pascal Libraries you use will be updated to support HEIC format, and this will then flow through to Renamer

Offline

#4 Today 04:33

skiwi
Member
Registered: 2009-06-15
Posts: 29

Re: ReNamer does not insert EXIF_Date when using heic-files

Here is a version that makes the EXIF data into a file system compatible filename

const
  EXE = 'exiftool.exe -t -charset filename=utf8';
  TAG = 'Date/Time Original' + '\t(.*?)[\r\n]';

var
  Command, Output, DateStr, NewDate: String;
  Matches: TWideStringArray;

begin
  Command := EXE + ' "' + FilePath + '"';

  if ExecConsoleApp(Command, Output) = 0 then
  begin
    Matches := SubMatchesRegEx(Output, TAG, False);

    if Length(Matches) > 0 then
    begin
      DateStr := Matches[0];
      // Expected format: YYYY:MM:DD HH:MM:SS
      // Build new format manually: YYYY-MM-DD HH.MM.SS
      NewDate :=
        Copy(DateStr, 1, 4) + '-' +      // YYYY-
        Copy(DateStr, 6, 2) + '-' +      // MM-
        Copy(DateStr, 9, 2) + ' ' +      // DD␣
        Copy(DateStr, 12, 2) + '.' +     // HH.
        Copy(DateStr, 15, 2) + '.' +     // MM.
        Copy(DateStr, 18, 2);            // SS
      // insert Date and Time as the start of Filename
      FileName := NewDate + ' ' + FileName;
    end;
  end;
end.

Last edited by skiwi (Today 04:49)

Offline

Board footer

Powered by FluxBB