ExifTool is an open source and cross-platform metadata editor
Metadata is useful in many ways, for instance when it comes to search or the representation of data. AÂ popular type is exif data that's associated with photos.
These are used for all kinds of purposes. Photographers use them to check various characteristics of a photo, e.g. the camera make and model, aperture or ISO.
But it's not the only kind of metadata. You may use ID3 tags for your music files for example. Similarly, documents, videos or images that you create contain other forms of metadata. Right-click on a file and select Properties > Details in Windows. The data that you may see will differ, but you should know that metadata can contain personally identifiable data such as the latitude and longitude (GPS location), date created/modified, or the author name.
You can edit or delete metadata with the help of programs like ExifTool by Phil Harvey. It is a command-line application (technically a script). Download the archive; it contains an executable. Don't run it though. Instead, drag and drop files or folders on it using Explorer. This will open a command window that displays the metadata of the file.
An alternative way to use it is to rename it from exiftool(-k).exe to exiftool.exe. Place it inside a folder that is a system path so that you may run it easier from the command prompt; this mode allows you to use all features in the application, so this is what we will be using here. When you want to use it, open a command window, drag and drop the exiftool.exe to the window to run it from its location. This method can also be used for adding an image's path quickly. Repeat the steps, add a space after "exiftool", and then drop the image onto the window before hitting Enter.
Look at these two screenshots. They contain a ton of metadata from just one photo I took on vacation last year.
The GPS data isn't shown because I chose not to include it, but you can tell from the image that it was taken on an ASUS device with the model number X00TD, which is the Zenfone Max Pro M1. The profile creator ID is Google, because I used the Google Camera app to take the image. There are a lot of other information (Megapixels, aperture, ISO, shutter speed, resolution time of the photo capture) embedded in the picture.
Why is this important? Say for example, you took a picture at your home and uploaded it on the internet. If you have not removed metadata before uploading to a service, or if the service does not scrub metadata automatically, others may look at the metadata which may reveal information that you don't want to become available.
How to remove, edit or extract exif data using Exiftool?
Deleting metadata
You have two options to delete exif data from files.
exiftool -exif:all= image.jpg
This tells ExifTool to delete all exif (personally identifiable) tags from the image's metadata. The program does not modify the original file. Instead, it creates a copy of it with the modified metadata, which can be useful for sharing online. The original file is renamed as image.jpg_original.
Alternatively, use the following command.
exiftool -all= image.jpg
This will delete even more tags (XMP). The resulting file will still have the regular properties of a file (size, name, date created, etc).
Editing tags
Editing exif data is pretty easy. Type exiftool followed by the attribute that you wish to change using the following syntax.
exiftool -attribute=edit image.jpg
Let's say we want to add something to an image, exiftool -Comment="This is gHacks" image.jpg. This will add an attribute called "Comment" and the value for it will be This is gHacks.
How do we remove exifdata? Let's use the comment tag as an example again. If you want to delete it, leave the comment's value blank. The command will be,
exiftool -Comment= image.jpg
Simple, isn't it? You can edit any tag that is displayed. Want to add tags? Here is a list of supported tags, and one more which mentions all read and write tags in Windows.
Batch editing
ExifTool supports batch exif deletion and editing too, all you have to is add several images after the command. For e.g. if we want to remove tags from 3 images.
exiftool -all= image.jpg image2.jpg image3.jpg
Editing images works in the same manner.
exiftool -Copyright=gHacks image.jpg image2.jpg image3.jpg
Ignore the maker notes error in the screenshot. This happens when Exiftool may not recognize the maker notes which could result in original data lost. But it wasn't in my case.
Batch editing also works with entire folders.
exiftool -all= H:\Photos
You can use wildcards like *.jpg, -GROUP:TAG=, etc to only edit specific files and tags.
Extracting metadata
To extract information from a picture just drag and drop an image as described earlier. You can save the content to a text document or CSV using a command like.
exiftool -T -common H:\Photos > H:\Photos\ghacks.txt
This saves common metadata from the files in the specified folder to the text file named ghacks.txt; it will be saved to the defined folder (in this case, the same directory). You can use -r for Recursive mode (creates one text document for each file), instead of a single tab delimited file.
There is a page on the official website that has more examples.
ExifTool is an open source application, written in Perl. I have just mentioned the basics of the program here, refer to the official documentation for more commands, tags, etc.
If you're looking for a way to view or edit EXIF, GPS, ID3, IPTC, XMP, MakerNotes, and other metadata, ExifTool is an excellent choice. It is used in third-party programs like Advanced Renamer, Batch Image Cropper.
I’ve used ExifTool quite a bit on my Mac, working from command line. (The Mac is basically Unix under the hood, so I use Bash as my shell in the Mac’s Terminal.) I also tried a GUI front end for ExifTool (not by the same developer) called pyExifToolGui, but I actually found that harder to use (and less powerful), especially for batch processing.
One mystery that I’ve never figured out: if I open a jpeg in ExifTool, and all I do is remove the value in one metadata field (and replace it with nothing)… the resultant JPEG has a slightly _larger_ filesize than the original! No idea why. I hope it’s not re-compressing the original JPEG (which could degrade its quality), but I haven’t noticed any degradation. Then why would removing a value cause the filesize to get bigger?
I could also hazard a guess that you are deleting an XMP tag if the file size grew. Try adding “-api compact=all” to your command to compact the XMP as much as possible when writing.
ExifTool doesn’t do any image manipulations. The change in file size may be due to a few factors that are discussed in some detail in ExifTool FAQ number 13: https://exiftool.org/faq.html#Q13
Of course, any spy worth his/her salt is going to add in a feature to the OS to replace the deleted metadata (or, at minimum, permanently report the activity). Apple is really smart about these things, for instance. macOS has a huge bag of tricks — from putting “deleted” data into unallocated space where it will live forever, to putting in hidden notices that various spyware features have been turned off.
Exiftool can read the metadata for many types of files but does not edit or create metadata for audio files (eg. ID3 or Vorbis Comments)
Hello, there are also free tools based on Exiftool that offers a GUI, which makes the changes easier if you are not familiar with the command line.
BTY, any similar tool to edit HEIC/HEIF pictures in the Windows environment?
Thanks, Pascal
ExifTool can edit metadata in HEIC/HEIF images
Nice review Ashwin
Dit you see in the exif info on your photo’s the Shuttercount?
Have a nice weekend
I’ve used Exiftool to extract all metadata to text file(s). Then I’ve used another program to recompress all the JPEG images to a lossless YCbCr Tiff format. This loses the metadata but saved a large amount of the required storage space. (All automated in a batch script).