Author Topic: Using Exiftool to match pics up with trips taken  (Read 133 times)

mindful crew

  • Newbie
  • *
  • Posts: 1
Using Exiftool to match pics up with trips taken
« on: March 14, 2019, 01:21:32 PM »
Hi there,

I am leading a development team looking to use EXIF information on photos in order to match the images to trips already logged on a web app. The trips have date ranges, and we would like the users to be able to upload pics via there iPhones/ipads etc to the app and have the images matched with the trips they have already taken/logged.  Could Exiftool be used for this?

Any help or advice would be greatly appreciated!!


  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2326
Re: Using Exiftool to match pics up with trips taken
« Reply #1 on: March 14, 2019, 01:50:37 PM »
As long as the exif data is correct and intact, then exiftool could be used to check if an image is in a date range.  The basic command would be along the lines of
exiftool -if "$DateTimeOriginal gt '2018:01:01' and $DateTimeOriginal lt '2018:02:01'" -DateTimeOriginal FILE

That command checks to see if the DateTimeOriginal value is between the string values of 2018:01:01 and 2018:02:01.  This is just a general example and you can manipulate things further as needed.  For example, using the -d (dateFormat) option with %s argument (-d %s), then the time stamp would be returned in epoch time and you could do exact numerical check.

This all would depend upon accurate data embedded in the image, of course.  If someone takes a screen shot of an image and then uploads that, there isn't going to be any data for you to check.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.