{"id":608,"date":"2012-07-06T22:59:08","date_gmt":"2012-07-06T20:59:08","guid":{"rendered":"http:\/\/blog.ulrichard.ch\/?p=608"},"modified":"2012-07-06T22:59:08","modified_gmt":"2012-07-06T20:59:08","slug":"correcting-the-date-in-the-exif-meta-data-of-a-jpeg-image","status":"publish","type":"post","link":"https:\/\/ulrichard.ch\/blog\/?p=608","title":{"rendered":"Correcting the date in the EXIF meta data of a jpeg image"},"content":{"rendered":"<p>Lots of cameras have a wrong date configured. Mine is even worse: It has a dead internal battery, so it looses the date and time every time I turn it off. When you take a picture, the wrong date is saved to the meta data tags of the resulting photographs. Afterwards, you import them with a photo management tool such as <a href=\"http:\/\/www.yorba.org\/shotwell\/\" target=\"_blank\" rel=\"noopener\">shotwell<\/a>, and they show up in the wrong place. Sorting doesn&#8217;t give you a chronological order. So I was looking for a simple tool to fix the embedded dates. I found exiv2. To install it, type:<\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\">sudo apt-get install exiv2<\/pre>\n<p>Strangely, it seems to allow only shifting the timestamp and not explicitly setting it. But that&#8217;s ok, it is probably the more common case. To adjust the timestamp from 25.7.2009 to 17.6.2012 execute the following:<\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\">exiv2 ad -Y3 -O-1 -D-8 ~\/Pictures\/2009\/07\/GOPR050*.JPG<\/pre>\n<h2>Update 06.09.2020:<\/h2>\n<p>Turns out it is also possible to set the date on images that had no EXIF data, although the command is a bit more verbose:<\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\">exiv2 -v -M\"set Exif.Photo.DateTimeOriginal 2020:09:05 07:17:00\" 09\/RunAndFly4.jpg<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lots of cameras have a wrong date configured. Mine is even worse: It has a dead internal battery, so it looses the date and time every time I turn it off. When you take a picture, the wrong date is saved to the meta data tags of the resulting photographs. Afterwards, you import them with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,1],"tags":[135,171],"class_list":["post-608","post","type-post","status-publish","format-standard","hentry","category-software","category-uncategorized","tag-linux","tag-photography"],"_links":{"self":[{"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=608"}],"version-history":[{"count":0,"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/608\/revisions"}],"wp:attachment":[{"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}