ExifTool Forum

General => Metadata => Topic started by: mindful crew on March 14, 2019, 01:21:32 PM

Title: Using Exiftool to match pics up with trips taken
Post by: mindful crew 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!!
Title: Re: Using Exiftool to match pics up with trips taken
Post by: StarGeek 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 (https://sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html#d-FMT--dateFormat) 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.