From: james <garftd@verizon.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] [SOLVED] Cellphone VFAT datestamps versus linux datestamps
Date: Fri, 31 Aug 2018 15:34:46 -0400 [thread overview]
Message-ID: <5c2c37ec-4198-dbd9-2dc7-d7e6b7dfe83e@verizon.net> (raw)
In-Reply-To: <20180830004529.GA27664@waltdnes.org>
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
prev parent reply other threads:[~2018-08-31 19:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <wrCeS-64V-1@gated-at.bofh.it>
2018-08-28 3:31 ` [gentoo-user] Cellphone VFAT datestamps versus linux datestamps james
2018-08-29 2:39 ` Walter Dnes
2018-08-29 5:35 ` james
2018-08-29 7:22 ` Neil Bothwick
2018-08-30 0:45 ` [gentoo-user] [SOLVED] " Walter Dnes
2018-08-31 19:34 ` james [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c2c37ec-4198-dbd9-2dc7-d7e6b7dfe83e@verizon.net \
--to=garftd@verizon.net \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox