

Image-altering apps can make this trickier.īut sometimes the fakery isn’t in the images themselves, but how they are used. With two lines of code, we can get a ame out of our EXIF data.In the age of fake news it’s more important than ever to verify the information we receive. Since our output is not a file, we'll have wrap our string with textConnection() to make it accessible to read.csv(). With that, we can use read.csv() to process the output. SourceFile,APP14Flags0,APP14Flags1,BitsPerSample,ColorComponents,ColorTransform,Compression,DCTEncodeVersion,Directory,EncodingProcess,ExifByteOrder,ExifToolVersion,FileAccessDate,FileInodeChangeDate,FileModifyDate,FileName,FilePermissions,FileSize,FileType,FileTypeExtension,GPSAltitude,GPSAltitudeRef,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef,GPSMapDatum,GPSPosition,GPSVersionID,ImageHeight,ImageSize,ImageWidth,JFIFVersion,Megapixels,MIMEType,ModifyDate,PhotometricInterpretation,Quality,ResolutionUnit,RowsPerStrip,SamplesPerPixel,StripByteCounts,StripOffsets,XResolution,YCbCrSubSampling,YResolution Pass the -csv parameter and you've got the output in nice parsing form, ready for R to convert to a ame. Luckily, the genious behind exiftool figured this out already.all you have to do is pass the -n parameter. Also, things like "GPS Latitude" are in a pretty unitelligible format (we'll probably want something like -94.526 instead of 94 deg 47' 56.41" W if we're going to do any processing in R). GPS Position : 38 deg 51' 20.15" N, 94 deg 47' 56.41" WĪs you can see, all the information we need is here, but it's not in a format that is particularly conducive to parsing in R. Once you have one in your RStudio project (or working directory), try the following:įile Modification Date/Time : 2015:11:21 14:16:21-04:00įile Access Date/Time : 2015:12:13 14:02:36-04:00įile Inode Change Date/Time : 2015:11:21 14:16:21-04:00Įxif Byte Order : Little-endian (Intel, II)Įncoding Process : Baseline DCT, Huffman coding Any photo taken by a digital camera has at least some kind of EXIF data, so this shouldn't be hard to find. The next thing you'll need is a photo with some EXIF data. If you can type system("exiftool") into your R console and not get any text saying "command not found", you're good to go.

#Read photo geotag windows#
In Windows you'll end up with an exiftool.exe file that you should put in your RStudio Project directory (or working directory, if you don't use RStudio).
#Read photo geotag install#
It's available for Windows, Mac, and Unix-oid systems (although it's a little more complicated to install on the unix-oid ones). Using the system() command in R, we can write a simple wrapper around the exiftool command that produces a nice ame with all the information about our image files.įirst thing is first, you're going to need to install exiftool. There is no package available for this, however exiftool, written by Phil Harvey, is a multi-platform command-line interface that extracts this data and outputs in a number of formats. Enter EXIF data, the format in which date/time, GPS, resolution, camera make/model, and a number of other fields are stored within image files. The photos came from a GPS with a camera, but because there were tons of duplicate files, any GPS waypoints they were associated with were lost. Recently I was tasked with organizing a large number of geotagged images extracted from several years of field data.
