On 8/29/18 8:45 PM, Walter Dnes wrote:
> On Wed, Aug 29, 2018 at 08:22:31AM +0100, Neil Bothwick wrote
>> On Tue, 28 Aug 2018 22:39:51 -0400, Walter Dnes wrote:
>>
>>>   Given this info, I can cobble together a short script.  A "for" loop
>>> cycles through "*.jpg".  Read "CreateDate" from the EXIF data, and feed
>>> it into the "touch" command, which would reset the physical file
>>> datestamp.
>>
>> You don't even need that, exiftool has a FileModifyDate tag, which is the
>> filesystem date not an EXIF tag, so you can simply set FileModifyDate to
>> CreateDate for each file.
>>
>> exiftool '-FileModifyDate<CreateDate' *.jpg
> 
>   Cool; I wasn't aware of that.  Definitely shorter than my version...
> 
> #!/bin/bash
> for filename in *.jpg
> do
>    datestamp0=`exiftool -T -CreateDate ${filename} | sed "s/[ :]//g"`
>    datestamp="${datestamp0:0:12}.${datestamp0:12:2}"
>    touch -t ${datestamp} ${filename}
> done
> 
>   I tried out your command on a few directories going back to April (I
> got the phone in March) and it works fine.  I have the directories
> sorted by date, and the generated datestamps match the day.  Also, the
> hour:minute stamps monotonitcally rise with the image sequence numbers,
> which is a good sign.
> 


Here is a useful parallel thread that give syntax options too:


https://discuss.pixls.us/t/date-stamp-exiftool-and-google-photos/8803


hth,
James

Reply via email to