exiftool is a platform independent command line and GUI application for reading, writing and editing meta information of images and media files. Metadata information can be GPS coordinates, tags, creation time, edit time, device name etc.
exiftool supports most of the operating systems like Windows, Ubuntu, Fedora etc. We will install exiftool in this part.
Ubuntu, Debian, Mint, Kali
exiftool is provided from the package named
libimage-exiftool-perl. So we will install with apt command like below.
$ sudo apt install libimage-exiftool-perl
Fedora, CentOS, RedHat
exiftool is provided with the package name
$ sudo dnf install perl-Image-ExifTool.noarch
We can download the exiftool for Windows operating systems from the following URL. This zip file provides a single executable file without any installation.
We just need to extract the file with WinZip, 7zip, WinRAR etc.
The Syntax of the exiftool is like below. We can see that there is 4 different syntax for different use cases like reading metadata, writing metadata, copying metadata and other operations.
List All Metadata of Given Image/File
We can list all metadata by providing the file we want to inspect. In this example, we will list all metadata of
Tux.png. As we can see this is a png file which is an image format.
$ exiftool Tux.png
As we can see there are a lot of metadata from a simple png file.
- `ExifTool Version Number` specifies the version of the tool which is 11.10
- `File Name` specifies the name of the file which is Tux.png
- `Directory` specifies the path which is the current working directory.
- `File Size` specifies the size of the given file which is 37 kB
- `File Modification Date/Time` specifies the modification date and time which is `2019:03:13 05:45:32-07:00`
- `File Access Date/Time` specifies the access date and time which is `2019:03:13 05:45:32-07:00`.
- `FileInode Change Date/Time` specifies the Inode or disk change date and time which is `2019:03:13 05:45:32-07:00`.
- `File Permissions` specifies current user, group and other permissions of the file which is `rw-rw-r–`.
- `File Type` specifies the type of the file which is `PNG` in this case
- `File Type Extension` specifies the extension of the file which is `png` in this example.
- `MIME Type` specifies the mime code of the file which is `image/ng` in this example
- `Image Width` specifies the width pixel count of the given image which is 300 in this case.
- `Image Height` specifies the height pixel count of the given image which is 354 in this case.
- `Bit Depth` specifies the pixel bit or quality which is 8 bit in this example.
- `ColorType` specifies the color representation which is `RGB with Alpha` in this case
- `Compression` specifies the compression type of the given image which is `Deflate/Inflate` in this example.
- `Filter` specifies the filter type.
- `Background Color` specifies the RGB representation which is `255 255 255`.
- `Modify Date` specifies the date the image modifies in original which is `2018:12:25 19:33:00`.
- `Datecreate` specifies the creation date and time of the original image `2018-12-25T19:33:00+00:00`
- `Datemodify` specifies the modification date and time of the original image `2018-12-25T19:33:00+00:00`
- `Megapixels` specifies the megapixel or pixel count in mega format which is 0.106 in this case.
Export Metadata Into HTML File
We can export metadata of given files or images into an HTML file format with the
-h option. In this example, we will export metadata of
Tux.png into HTML name Tux.html.
$ exiftool -h Tux.png > Tux.html
List Metadata In CSV Format
We can print given file and images metadata in CSV format. This can be a single file or image or a whole directory which can contain multiple files and image. In this example, we will print
$ exiftool -csv /home/ismail/Downloads/
List Specific Metadata
We can also list and print specific metadata by using
grep command. In this example, we will print
Image Width metadata.
$ exiftool Tux.png | grep "Image Width"
We can also write or overwrite metadata of the given file. In this example, we will overwrite the
Rights metadata of
$ exiftool -overwrite_original -rights="©2019 Poftut.com" All.doc