1 |
On 8/29/18 8:45 PM, Walter Dnes wrote: |
2 |
> On Wed, Aug 29, 2018 at 08:22:31AM +0100, Neil Bothwick wrote |
3 |
>> On Tue, 28 Aug 2018 22:39:51 -0400, Walter Dnes wrote: |
4 |
>> |
5 |
>>> Given this info, I can cobble together a short script. A "for" loop |
6 |
>>> cycles through "*.jpg". Read "CreateDate" from the EXIF data, and feed |
7 |
>>> it into the "touch" command, which would reset the physical file |
8 |
>>> datestamp. |
9 |
>> |
10 |
>> You don't even need that, exiftool has a FileModifyDate tag, which is the |
11 |
>> filesystem date not an EXIF tag, so you can simply set FileModifyDate to |
12 |
>> CreateDate for each file. |
13 |
>> |
14 |
>> exiftool '-FileModifyDate<CreateDate' *.jpg |
15 |
> |
16 |
> Cool; I wasn't aware of that. Definitely shorter than my version... |
17 |
> |
18 |
> #!/bin/bash |
19 |
> for filename in *.jpg |
20 |
> do |
21 |
> datestamp0=`exiftool -T -CreateDate ${filename} | sed "s/[ :]//g"` |
22 |
> datestamp="${datestamp0:0:12}.${datestamp0:12:2}" |
23 |
> touch -t ${datestamp} ${filename} |
24 |
> done |
25 |
> |
26 |
> I tried out your command on a few directories going back to April (I |
27 |
> got the phone in March) and it works fine. I have the directories |
28 |
> sorted by date, and the generated datestamps match the day. Also, the |
29 |
> hour:minute stamps monotonitcally rise with the image sequence numbers, |
30 |
> which is a good sign. |
31 |
> |
32 |
|
33 |
|
34 |
Here is a useful parallel thread that give syntax options too: |
35 |
|
36 |
|
37 |
https://discuss.pixls.us/t/date-stamp-exiftool-and-google-photos/8803 |
38 |
|
39 |
|
40 |
hth, |
41 |
James |