I'd like to add the dates of the pictures one by one.

Started by nt11062, October 06, 2023, 04:56:06 AM

Previous topic - Next topic

nt11062

There are 100 photo files in the folder.
The date of the first photo is 2023:01:01 12:34:23

I want to increase the date one by one using the for statement.

The first picture 1.jpg is 2023:01:01 12:34:23
The second photo 2.jpg is 2023:01:02 12:34:23
The third picture 3.jpg is 2023:01:03 12:34:23..

What should I do?


:top
@echo.
@set /p dir="Drag and enter the photo folder over this window:"
@%dir:~1,2%
@cd %dir%
@echo.

:camera
@set /p date="start date (ex. 2019:05:01 13:45:32) : "
@echo.

@set sum=1
@for /L %%i in (1,1,100) do (
@exiftool -AllDates="%date%" "%%i".jpg
  echo %%i
  set /a sum+=%%i
  exiftool -AllDates+=24 "%%i".jpg
  set date+=0:0:1 0:0:0
)


@echo complete.
:more
@set /p more="work more?(y or n) "
@if "%more%"=="y" goto top
@if "%more%"=="n" goto exit
@goto more

:exit
@echo. Press any key to exit.
@pause >nul
@exit



Phil Harvey

This uses some advanced techniques, but this command should do what you want:

exiftool "-alldates<${filename;$_='2023:01:01 12:34:23';ShiftTime($self->GetValue('FileSequence').' 0')}" DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).