LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices


Reply
  Search this Thread
Old 06-11-2017, 06:24 AM   #1
trafikpolisen
Member
 
Registered: Jun 2008
Posts: 121

Rep: Reputation: 3
Wrong timestamp on photos copied from memory card in Mint 18


Hi!

Yesterday I noticed that the modified time on photos copied to my computer from a memory card was two hours off. I checked photos copied to the computer before I upgraded to Mint 18 and there the time is correct. I had a search on Google and I think the bottom line is some bug (not in Mint itself) which makes the system assume that timestamps is in UTC on the fat-formatted card and thus compensating for that to CEST.
I found this "solution":
https://forums.linuxmint.com/viewtopic.php?t=234372
But this feels more like a workaround than a solution and when I entered the suggested command (timedatectl set-local-rtc 1) I got a warning that having the the system clock at local time wasn't fully supported (or something of that sort), so I reverted to the original setting.
I later found this workaround on some site that mounts cards with a time offset:
Quote:
mount -t vfat -o iocharset=utf8,time_offset=$((`date +%:z|sed -r 's/^(.)0?(.*):0?/\1\2*60\1/'`)) "$@"
This works, but is a bit of a pain, since I have to unmount the card first.
So, I have three questions.

1. Is there a hope for an update that will fix this issue?

2. What would be the best solution/workaround in the meantime?

3. Since I have rather a few photos that I've copied to the computer before I discovered the problem I have an idea of writing a script that reads the time/date in the EXIF-info of all the files in a folder and then updates the file times/dates with touch. But I think I need some tool to read the EXIF-info and my knowledge of scripting in Linux is close to zero. So I hope maybe someone could help me in the right direction

Thank you!

Last edited by trafikpolisen; 06-11-2017 at 06:28 AM.
 
Old 06-11-2017, 07:30 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Regarding #3, exiftool should do the trick e.g. to adjust the EXIF timestamp forward two hours for all jpg files in the directory:

Code:
exiftool "-AllDates+=2" -verbose *.jpg
 
1 members found this post helpful.
Old 06-11-2017, 08:17 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
I wish I had seen something like that back when I had hundreds of photos off by one year.

If what you are trying to do is set the file system time stamp to match the EXIF data, then you'll want a recipe more like this:

Code:
exiftool '-FileModifyDate<DateTimeOriginal' *.jpeg
There's more recipes at the exiftool page. Or in the manual page for exiftool itself.
 
1 members found this post helpful.
Old 06-11-2017, 10:27 AM   #4
trafikpolisen
Member
 
Registered: Jun 2008
Posts: 121

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by Turbocapitalist View Post
I wish I had seen something like that back when I had hundreds of photos off by one year.

If what you are trying to do is set the file system time stamp to match the EXIF data, then you'll want a recipe more like this:

Code:
exiftool '-FileModifyDate<DateTimeOriginal' *.jpeg
There's more recipes at the exiftool page. Or in the manual page for exiftool itself.
Wow, I'll look into that! If it's that easy I won't even need a script I just had a quick look on the exiftool page and it seems I can also update the dates in the exif-info just as easy, which could come in handy as I almost always forgets to set the camera to the correct time for a few weeks when time changes to and from daylight saving time.

Will this work with CR2 (Canon RAW-files) as well? And also, if I would update the date/time in the exif-info in a file with this tool, would that file be identical to one coming straight out of the camera apart from the date/time, i.e. would everything else be untouched?

Never mind the question about CR2 support, just saw that it was in the supported file list on the exiftool page.

Last edited by trafikpolisen; 06-11-2017 at 10:34 AM.
 
Old 06-11-2017, 10:34 AM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by trafikpolisen View Post
Wow, I'll look into that! If it's that easy I won't even need a script I just had a quick look on the exiftool page and it seems I can also update the dates in the exif-info just as easy, which could come in handy as I almost always forgets to set the camera to the correct time for a few weeks when time changes to and from daylight saving time.

Will this work with CR2 (Canon RAW-files) as well? And also, if I would update the date/time in the exif-info in a file with this tool, would that file be identical to one coming straight out of the camera apart from the date/time, i.e. would everything else be untouched?
It should do. Check out the Supported File Types section at http://www.sno.phy.queensu.ca/~phil/exiftool/ .

As far as I know, exiftool doesn't change anything apart from what you explicitly tell it to. You can confirm this by running exiftool with no parameters on an original image to obtain information on it, and then redoing that on the converted file, comparing both outputs with something like diff (command line) or meld (GUI).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Memory card created with unetbootin + Mint 17 fails to boot pbalm Linux - Desktop 8 08-23-2014 05:25 AM
Folder copied to Samba from OSX machine has wrong permissions anon091 Linux - Server 0 06-13-2013 05:44 PM
Add a timestamp to photos by reading the file date...? FSHero Linux - Software 4 09-14-2007 12:15 AM
NFS mount - wrong timestamp noir911 Linux - Server 2 03-04-2007 05:26 AM
lspci -v showing wrong memory size for video card (NVIDIA Geforce4 Ti4200 8X) [NL]_Target Linux - Hardware 0 06-27-2004 10:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint

All times are GMT -5. The time now is 06:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration