Skip to content

Instantly share code, notes, and snippets.

@bilalelreda
Last active March 1, 2020 03:49
Show Gist options
  • Save bilalelreda/1fa6b0eed6dd98ccabd7e07e4c933bfe to your computer and use it in GitHub Desktop.
Save bilalelreda/1fa6b0eed6dd98ccabd7e07e4c933bfe to your computer and use it in GitHub Desktop.

Revisions

  1. bilalelreda revised this gist Mar 1, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion jhead-fix-exif-dates.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    Installing Jhead on Mac OS X using [Homebrew](https://brew.sh/).

    ```
    brew install ahead
    brew install jhead
    ```


  2. bilalelreda revised this gist Aug 10, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion jhead-fix-exif-dates.md
    Original file line number Diff line number Diff line change
    @@ -40,4 +40,4 @@ This is not strictly necessary but can be useful if you want your file system’
    jhead -ft *.jpg
    ```

    *credit: https://monkeyhybrid.com/2012/03/fix-exif-dates-and-times-with-jhead/*
    *Credit: https://monkeyhybrid.com/2012/03/fix-exif-dates-and-times-with-jhead/*
  3. bilalelreda revised this gist Aug 10, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion jhead-fix-exif-dates.md
    Original file line number Diff line number Diff line change
    @@ -40,4 +40,4 @@ This is not strictly necessary but can be useful if you want your file system’
    jhead -ft *.jpg
    ```

    credit: https://monkeyhybrid.com/2012/03/fix-exif-dates-and-times-with-jhead/
    *credit: https://monkeyhybrid.com/2012/03/fix-exif-dates-and-times-with-jhead/*
  4. bilalelreda renamed this gist Aug 10, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. bilalelreda created this gist Aug 10, 2019.
    43 changes: 43 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    # Fix EXIF dates and times with Jhead


    Installing Jhead on Mac OS X using [Homebrew](https://brew.sh/).

    ```
    brew install ahead
    ```


    ## Modifying the EXIF Date and Time

    You adjust the date/time of the photos based on an offset. If, for example, your photo’s times are set 1 hour too far in to the future, we can subtract a single hour from all photos using the following.

    ```
    jhead -ta-1:00 *.jpg
    ```

    If the photos were set 12 hours, 20 minutes and 43 seconds too far in the past, we’d offset with a positive value.

    ```
    jhead -ta+12:20:43 *.jpg
    ```

    For offsets greater than 24 hours, we can use the -da option followed by two dates in yyyy:mm:dd format, or to include a time, as yyyy:mm:dd/hh:mm:ss. Because years and months have different numbers of days, rather than specifying an offset, we actually specify two dates for this option – the first being the date to translate to, relative to the second.

    So if a particular photo was taken on the 29th February 2012 at 8:21am, but the camera recorded it as the 1st January 2000 at 2:24pm, we would use the following.

    ```
    jhead -da2012:02:29/08:21-2000:01:01/14:24 *.jpg
    ```

    It doesn’t matter that the photos weren’t all taken at the very same time specified by either date in this argument, Jhead will just work out the correct offset to use from the before and after dates and apply it correctly to each photo individually.

    ## Setting the File System’s Timestamp

    This is not strictly necessary but can be useful if you want your file system’s file creation dates to now match those of the newly fixed EXIF dates.

    ```
    jhead -ft *.jpg
    ```

    credit: https://monkeyhybrid.com/2012/03/fix-exif-dates-and-times-with-jhead/