Skip to content

Simple command-line utility to shift the DateTaken EXIF metadata (ID 36867) of images by a number of hours.

License

Notifications You must be signed in to change notification settings

ToastyMallows/HourShifter

Repository files navigation

HourShifter

Simple command-line utility to shift the DateTaken EXIF metadata (ID 36867) of Jpeg images by a number of hours.

Dependencies

Windows

None

Unix

  • libgdiplus
  • libc6-dev

MacOS

None? Using runtime.osx.10.10-x64.CoreCompat.System.Drawing

Compiling

Currently targeting .NET 5.

Windows

  • > .\build.ps1 (RID "win-x64" is the default)

Unix

⚠ This application currently does not work on Unix-based systems because of this bug.

  • > ./build.sh --rid="linux-x64"

MacOS

⚠ This application currently does not work on MacOS systems because of this bug.

  • > ./build.sh --rid="osx-x64"

Debugging

⚠ In order to debug you need to find/replace $(RID) and replace it with the current operating system's RID that you're targeting. See the full list of runtime identifiers (RIDs) here: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog

Publishing

Create a self-contained release for a certain RID:

Windows

  • > .\build.ps1 --target=Publish (RID "win-x64" is the default)

Linux

  • > chmod +r build.sh
  • > ./build.sh --target=Publish --rid="linux-x64"

MacOS

  • > chmod +r build.sh
  • > ./build.sh --target=Publish --rid="osx-x64"

NOTE: See the full list of runtime identifiers (RIDs) here: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog

Check Releases on Github for the pre-compiled release for your operating system. If your specific release isn't pre-built, pull down the code and build it locally.

Command-line Arguments

  • -h, --hours

    • Will shift all image DateTaken EXIF metadata found in the current directory and all subdirectories by a number of hours. The default value is 12.
    • Ex:
      • -h 5
      • -h -2
  • -c, --currentDirectoryOnly

    • Flag for only searching the current directory, NOT subdirectories. The default is false (subdirectories WILL be searched.)
  • -l, --logLevel

    • Flag to control the log level of the application. Default: Info. Acceptable values: Debug, Info, Warn, Error
  • -q, --quiet

    • Flag for showing any output or waiting to press any key to exit. Program will run and exit immediately without any output. Log level is ignored.
  • --help

    • Displays help screen.
  • --version

    • Displays version information.

Why?

While importing pictures scanned with the Epson FastFoto FF-640 to Google Photos, I noticed that the DateTaken EXIF metadata was defaulted to a time of 00:00, but that the Date was correct. When uploaded to Google Photos, it thought that the Time Zone was Central, which meant that all of the photos were showing a taken date of the previous day. Windows doesn't seem to let you modify the time of the DateTaken value, so this was my quick solution.

Problems?

Submit an issue or pull request 😃