Computer

EXIF, what it is and what the photos we take really contain

EXIF, what it is and what the photos we take really contain

When you take a photo with your smartphone or digital camera, the image not only contains the visible image but also a truly considerable amount of data, hidden between the “folds” of the image itself. This is metadata EXIFacronym for Exchangeable Image File Format.

EXIF data is encoded directly into the image file itself and collects metadata such as the location where the photo was taken (so you can view the photos on a map later), the time and date taken, the lenses and zoom levels used, the exposure, ISO values, focal aperture and many more.

Information contained in photos as EXIF ​​metadata is especially useful for i professional photographers and photography enthusiasts, as it allows them to track the settings used for each photo and evaluate how to improve their photography skills. The data can also be useful for organizing and categorize images as well as for research purposes, allowing you to search and filter images.

Many messaging platforms and tools remove EXIF ​​data for reasons of privacy. Otherwise, by opening an image and examining the corresponding metadata, a third-party user could establish with certainty where a photo was acquired and trace, for example, the another person’s position. In another article we saw how to remove EXIF ​​metadata from photos when sharing or publishing images online. We have also seen how to delete additional file properties in Windows with one automated procedure.

Where is the EXIF ​​metadata located

As we saw in the article on binary code, if you have a hex editor like HxD and open any JPEG file exported from your phone or camera, at the beginning of it you will find a header EXIF which anticipates the actual image data. The EXIF ​​data marker (FFE1) appears immediately after the marker indicating the beginning of the file (FFD8).

EXIF, header file structure

In Windows, per see EXIF ​​data just right click on an image in File Explorer then choose Property and finally access the tab Details.

Dati EXIF in Windows

To have a complete “rundown” of the metadata, you can also refer to the Harley Turan website and click on the button Choose file just below the paragraph What’s in a photo?.

Don’t worry about it confidentiality of your photos: the images never leave the web browser and all processing is done locally without transferring the data elsewhere.

If you have one photo library and you want to generate a spreadsheet with all the EXIF ​​data automatically extracted from the images, you can use the free ExifTool software, already presented in the article mentioned at the beginning. For example, you can use the following syntax:

exiftool -r -n -csv > nomefile.csv /percorso_foto

  • -csv: Specify the output format come CSV.
  • -r: Executes the recursive scan of all subfolders within the specified folder.
  • -n: Format numbers without thousands separator.
  • nomefile.csv: Specify the name of the CSV file which will contain the EXIF ​​data.
  • /percorso_foto: To be replaced with the folder path containing the images to be processed.

View where an image was taken on Google Maps

Take the data relating to latitude and to longitude (North latitude, East latitude) then copy them to the following address (leave the “+” symbol between the latitude and longitude values):

https://maps.google.com/maps?t=k&q=LATITUDINE+LONGITUDINE

By pasting the URL thus obtained into the address bar of the browser, it is possible to add a placemark on the Google Maps map at the shooting location of the image.

The operating system Apple iOS enriches photos with additional metadata: there is information about the faces within the images, including position in terms of Cartesian coordinates (x,y), size (width, height) and angles (yaw, roll). This is for everyone face detected in every photo.

Plus the property FaceIDassigned to each face, is an integer that refers to the corresponding face identifier within the card People in the app Photo. Turan hypothesizes that lower FaceID values ​​indicate the presence of closest acquaintances within the images.

How to process images using EXIF ​​metadata

By installing SQLite, available for all operating systems, you have a database available for interrogate one’s photographic archive. SQLite can be downloaded by clicking here.

With the following commands, issued from the operating system terminal window (from the folder where SQLite is installed), you can import the EXIF ​​data previously saved into the CSV file:

sqlite exif.db
sqlite> .mode csv
sqlite> .import nomefile.csv foto
sqlite> SELECT count(*) FROM foto;

The last command corresponding to a query SQL which counts the number of records and therefore photos imported into the table Photo. The beauty of this mode of operationpresented by Turan in his article, is that the contents of a CSV file automatically become a database easy to consult and query.

At this point, as Turan did, it is possible to give vent to your imagination by extracting the information about photos contained in the archive.

Which photo has the most faces? In which photos is the subject too close for proper focus? How many and which photos were taken at over 50 km/h? Which photos were captured at sunset? Which photos were taken by dropping the smartphone?

This and other questions can be answered with simple SQL queries designed by observing and studying the column headings present in the CSV file with the EXIF ​​data.

Leave a Reply

Your email address will not be published. Required fields are marked *