Tutorial

ExifTool : A Meta-Data Extractor

In this article, we’ll discover various methods to read, write and manipulate the meta-data information recorded in a variety of file types. In order to achieve this, we’ll be using a tool known as “ExifTool”.  EXIF is an acronym for Exchangeable Image File Format and it is a standard for the inclusion of metadata in certain file types.

Table of Content

  • Introduction to ExifTool
  • Installation
  • Usage of ExifTool

    • Extract the Common Meta-Data Information
    • Extract the Specific Meta-Data Information
    • Extract GPS Co-ordinates
    • Extract Thumbnail Image
    • Extract metadata using specific keywords
  • ExifTool’s Verbose Mode
  • Writing the Meta-Data Information
  • Removing Meta-Data Information
  • Saving outputs

    • In HTML file
    • In-Text File
  • Extracting EXIF data from a Video file

Introduction

ExifTool is developed by Phil Harvey. It is a platform-independent Perl library coupled with a full-featured command-line implementation for reading, writing and manipulating the metadata across a broad range of files, particularly the JPEG images. This metadata may comprise a bunch of information such as the camera make, file type, permissions, file size etc., though it further offers more details about the photograph, like the exposure, the shutter speed and whether the flash fired or not. ExifTool probably gives us the simplest way to extract metadata from files, as it is free and an open-source program.

Installation

Exiftool is quite easy to deploy. It’s just about hitting our Linux terminal and cloning the tool from GitHub.

In addition, we need to install the necessary package for it.

So, we’ve mounted the tool in our system. Let’s take a closer look at it.                                                

Usage of Exiftool

To extract the entire metadata of a file, we just need to execute the given below command:

From the below image, you can now notice that we’ve got all the information drawn from our image file from the very basic to advance.

However, if we need to capture the ids along with exif tags in the Hexa-Decimal format, though we need to run the following command:

From the below image, we can see that there is a lot of information stored within these Exif tags.

Extract the Common Meta-Data Information

Now execute the given below command which will provide us with the output of the most common Exif tags of the image file.

Extract the Specific Meta-Data Information

We can list a particular meta-information of our image file by simply executing the command given:

From the below image, we get our desired output displayed along with their respected tag names in a list type format.

Extract GPS Co-ordinates

The photographs we capture using our smartphones or camera have GPS coordinates embedded as metadata in the image files. To obtain this, we just need to fire the command given below:

Here we got the GPS Position, now just copy and paste this complete coordinate information over Google Maps and we will get the exact location of the camera when the picture was taken.

Extract Thumbnail Image

Thumbnails are the original preview images basically compressed. These are just created to open the original images more quickly and act as place holders to them. In order to extract these thumbnail images, we just need to execute the following command:

Here we can see that the thumbnail.jpg file is extracted from the test.jpg image.

Extract metadata using specific keywords

The following command will assist us to extract the metadata information associated with some specific keywords.

From the below picture, we can see that our fired command displays all tags with names containing the word “Image” from the file.

ExifTool’s Verbose Mode

Verbose mode generates extended information i.e. when we add [-v] to the exiftool command it will display us the comprehensive data about the process that it is performing.

Writing the Meta-Data

ExifTool provides us with a great power to write most of the information on the EXIF tags, that anyone might want to alter, but some tags are protected because they describe the image’s physical characteristics that we can’t change with ExifTool, such as compression.  Also, other tags like the GPS, the MakerNotes, this information can be edited.

To manipulate the exif data we need to execute the following command:

Here we can see that the information stored in the “Make” tag is replaced from “OPPO” to “HackingArticles”. While writing the information, ExifTool’s script automatically preserves the original file by adding “_original” to the end of the file name.

Removing Meta-Data Information

We have only extracted or manipulated the EXIF data so far, but what if we want to remove or delete all the metadata from an image file. Just execute the following below command, let’s see how this works:

It shows 1 image files uploaded. The “test.jpg” EXIF data has been removed effectively. Although let’s attempt to extract the metadata from “test.jpg” again, hence we’re just getting the basic information of the image and the rest is deleted.

Saving outputs in Multiple Format

  1. In HTML file

We will save the ExifTool’s output in an HTML file in order to maintain the records and for better readability. To do this we will use the parameter “-h” along with the exiftool’s command and save the results in a file with .html extension.

Here, we can see test.html file is generated. Although we just need to open it to check our EXIF data output in any of our browsers.

  1. In-Text File

We can even export our exifdata to a text file similar to the output of the HTML. To achieve this, we simply need to execute the following commands:

Further, we can also monitor our output either by opening it in any of the text editors or by simply running the command: 

Extracting ExifData from a Video file

ExifTool not only extract metadata from the jpg file format but can also read and write in a variety of files. To know more click here.

We will now extract the entire meta-data information from an mp4 video file. To extract this, we will run the basic exiftool’s command i.e.

Conclusion

This was Exiftool’s complete usability guide as a meta-data extractor. It is user-friendly and convenient because of its simple command-line implementation. It has thus become one of the best tools to extract meta-data data from a variety of file formats.

Author: Chiragh Arora is a passionate Researcher and Technical Writer at Hacking Articles. He is a hacking enthusiast. Contact here

You Might Also Like

Leave a Reply