ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: lumiere on December 25, 2021, 05:40:22 PM

Title: Why this picture hasn't been moved
Post by: lumiere on December 25, 2021, 05:40:22 PM
I noticed that some of my pictures havent been moved to the target folder and did an experiment with one of those files:

$ exiftool -time:all -s 2002-12-08_12\:00\:00_10.jpg
FileModifyDate                  : 2014:02:09 12:31:30+00:00
FileAccessDate                  : 2021:12:25 22:32:40+00:00
FileInodeChangeDate             : 2021:12:25 22:32:20+00:00
DateTimeOriginal                : 2014:02:09 12:31:30
CreateDate                      : 2002:12:08 12:00:00
$ ls -la
total 1044
drwxr-xr-x 2 my my    4096 Dec 25 22:32 .
drwxr-xr-x 3 my my    4096 Dec 25 22:31 ..
-rw-r--r-- 1 my my 1059249 Feb  9  2014 2002-12-08_12:00:00_10.jpg
$ exiftool --ext pdf -api QuickTimeUTC '-CreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal'  '-filename<CreateDate' '-filename<DateTimeOriginal' -d pictures/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r .
1 directories scanned
1 directories created
1 image files created
$ ls -al
total 1048
drwxr-xr-x 3 my my    4096 Dec 25 22:33 .
drwxr-xr-x 3 my my    4096 Dec 25 22:31 ..
-rw-r--r-- 1 my my 1059249 Feb  9  2014 2002-12-08_12:00:00_10.jpg
drwxr-xr-x 3 my my    4096 Dec 25 22:33 pictures
$ ls -al pictures/
total 12
drwxr-xr-x 3 my my 4096 Dec 25 22:33 .
drwxr-xr-x 3 my my 4096 Dec 25 22:33 ..
drwxr-xr-x 3 my my 4096 Dec 25 22:33 2014
$ ls -al pictures/2014/
total 12
drwxr-xr-x 3 my my 4096 Dec 25 22:33 .
drwxr-xr-x 3 my my 4096 Dec 25 22:33 ..
drwxr-xr-x 3 my my 4096 Dec 25 22:33 02
$ ls -al pictures/2014/02/
total 12
drwxr-xr-x 3 my my 4096 Dec 25 22:33 .
drwxr-xr-x 3 my my 4096 Dec 25 22:33 ..
drwxr-xr-x 2 my my 4096 Dec 25 22:33 09
$ ls -al pictures/2014/02/09/
total 1044
drwxr-xr-x 2 my my    4096 Dec 25 22:33 .
drwxr-xr-x 3 my my    4096 Dec 25 22:33 ..
-rw-r--r-- 1 my my 1059249 Feb  9  2014 2014-02-09_12:31:30.jpg
$ exiftool -time:all -s pictures/2014/02/09/2014-02-09_12\:31\:30.jpg
FileModifyDate                  : 2014:02:09 12:31:30+00:00
FileAccessDate                  : 2014:02:09 12:31:30+00:00
FileInodeChangeDate             : 2021:12:25 22:33:49+00:00
DateTimeOriginal                : 2014:02:09 12:31:30
CreateDate                      : 2014:02:09 12:31:30

Why the original file hasn't been moved and just copied ?
Title: Re: Why this picture hasn't been moved
Post by: StarGeek on December 25, 2021, 05:43:39 PM
It the file locked and opened in another program?
Title: Re: Why this picture hasn't been moved
Post by: lumiere on December 25, 2021, 06:19:45 PM
Quote from: StarGeek on December 25, 2021, 05:43:39 PM
It the file locked and opened in another program?

No, it isn't. I just copied it from the original tree of pictures for this test.
Title: Re: Why this picture hasn't been moved
Post by: lumiere on December 25, 2021, 06:25:33 PM
Test again

$ tree .
.
└── source
    └── 2002-12-08_12:00:00_10.jpg

1 directory, 1 file

$ exiftool --ext pdf -api QuickTimeUTC '-CreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal'  '-filename<CreateDate' '-filename<DateTimeOriginal' -d pictures/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r source/
1 directories scanned
1 directories created
1 image files created

$ tree .
.
├── pictures
│   └── 2014
│       └── 02
│           └── 09
│               └── 2014-02-09_12:31:30.jpg
└── source
    └── 2002-12-08_12:00:00_10.jpg

5 directories, 2 files
Title: Re: Why this picture hasn't been moved
Post by: StarGeek on December 25, 2021, 08:07:16 PM
Oh yeah, I always forget this.  See the Notes (https://exiftool.org/filename.html#Notes) on the "Writing FileName and Directory tags" page
    Writing the FileName and/or Directory tags alone causes the file to be renamed or moved, not copied. However, if any "real" tags are written at the same time, then the file is rewritten to the new destination and the original file is left unchanged. (Only writable system tags may be set without causing the file to be rewritten.) If desired, the -overwrite_original option may be used to remove the original copy when the file is rewritten.