Skip to content

Conversation

@brandl-muc
Copy link

@brandl-muc brandl-muc commented Jan 4, 2026

The README.md suggests to run exiftool with the following command:

exiftool -overwrite_original -r -if 'not defined DateTimeOriginal' -P "-AllDates<FileModifyDate" "your/output/folder/ALL_PHOTOS/"

For me, this always yields n files failed condition.

At first, I shrugged and brushed this off, assuming that all files had the DateTimeOriginal tag. But later, I became suspicious and run tests with two files, one with the tag and one without it. (but both with a CreateDate tag to have something to print)
To cut it short, the current command does not work as expected:

 exiftool -if 'not defined DateTimeOriginal' -CreateDate .
    1 directories scanned
    2 files failed condition
    0 image files read

Actually, the tag name needs a dollar sign as prefix:

% exiftool -if 'not defined $DateTimeOriginal' -CreateDate .
======== ./no_dto.jpg
Create Date                     : 2025:07:02 20:49:00
    1 directories scanned
    1 files failed condition
    1 image files read

For reference, see also exiftool man on -if

EXPR is a Perl-like logic expression containing tag names prefixed by $ symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant