ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Correcting the file timestamp for JPG files using jhead

    IT Discussion
    jhead pictures file date exif
    1
    1
    605
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JaredBuschJ
      JaredBusch
      last edited by JaredBusch

      When I was migrating things around after dropping Windows for Korora 25, I accidentally missed a switch at some point and lost all the original timestamps on my files that I migrated.

      I do not care about most things, but for all my photos, I really miss having the file timestamps match the Exif data (aka the original timestamps).

      A quick google led me to a few options, but I chose jhead for its simplicity. There are some other options that are quite a bit more powerful. But I did not need those feature for this.

      Install jhead

      #fedora has in in the base repository
      dnf install -y jhead
      
      #centos needs the EPEL
      yum install -y epel-release
      yum install -y jhead
      

      Using it is extremely simple.
      Just change to the directory you want to fix and use the -ft switch (fix time)

      cd ~/Pictures
      jhead -ft
      

      Now if you are like me, you will have a bunch of sub folders and such. jhead does not do recursion, but this is easy enough with a find command.

      cd ~/Pictures
      find -iname '*.jp*g' -exec jhead -ft {} +
      

      The man page for jheadhas more details on what else it can do. But this was all I needed out of it, and it worked brilliantly.

      Website for jhead: http://www.sentex.net/~mwandel/jhead/

      1 Reply Last reply Reply Quote 7
      • 1 / 1
      • First post
        Last post