Most users probably do not know that a photo from a mobile phone contains other data in addition to the actual image. In principle, every file MetadataThis is information that is stored in addition to the actual content.
For example, a photo can contain information about the DSLR camera, focal length, ISO value or geodata, a music file can contain the sample rate, bit depth, genre or artist, a software binary can contain the compiler used. This is data that makes it easier to use and sort with many programs.
There are various metadata standards such as Exif, IPTC and XMP. In practice, all of them are used in different file formats. The common metadata programs can handle all standards.
Reading tip: Why Linux is more secure than Windows
The advantage of metadata is obvious: it provides information that software can use to sort or filter. Photographers can see at a glance which technology was used for someone else’s photo and which program was used for post-processing.
However, metadata also has disadvantages: Cyber criminals, authorities and digital companies can use it to collect data about people. While internal tags may even be beneficial for the MP3 collection, information about the smartphone used, the name of the author or the geolocation of a photo can pose a security risk.
At https://netzpolitik.org you will find frightening examples of what metadata reveals about personal interests, movement data, details of paid work, sleeping times or personal relationships. Big data giants can use this to collect even more information about individuals and turn it into money. In principle, it can even be used to easily monitor people.
Fortunately, there are programs that allow you to edit metadata with just a few clicks or commands, or can be completely removedEspecially before sharing data on the Internet, you should think about whether the metadata should remain in the file.
There are various ways to remove metadata – either completely or individually. If you like it simple and with a graphical interface, use the program Metadata Cleaneralso “Metadata Cleaner”, which is offered as a Flatpak. If – as in Linux Mint – there is a software center including Flatpaks, you can search for it there and install it.
Otherwise, this command helps:
sudo flatpak install flathub fr.romainvigier.MetadataCleaner
You can drag and drop files or entire folders from the file explorer into the program window and the tool removes all recognized metadata in one go. If you are looking for a mobile solution for Android, you should use Scrambled Exif in the F-Droid Store.
Both solutions edit the files directly – metadata is then irrevocably removed. The standard image viewer gthumb under Gnome & Co. can also delete metadata using the wrench symbol. There are always a few remnants of information about the file left over – slightly more than with the Metadata Cleaner.
There are a number of proven tools for the terminal, the most important of which are exiftool, exiv2 and mat2. All three tools are available with the same package name in the standard package sources and are thus roughly the same as
sudo apt install exiftool
quickly installed. The first two hardly differ in terms of scope: Exiftool is written in Perl, exiv2 in C++ and is therefore theoretically somewhat more performant.
In practice, no difference in speed is noticeable for individual files, so the examples here refer to the somewhat more comprehensive exiftool, which can not only delete but also edit.
The third tool, mat2, can only delete files – but it does so completely and reliably. All three programs support all common file types. The following examples refer to photos and images, but can be transferred to other file types.
The available metadata is displayed via
exiftool bild.jpg
To remove all metadata in one go, simply
exiftool -all=bild.jpg
With representatives such as “*.jpg” you can process all files in a folder. And if necessary, find extends the range:
find /(Pfad) -iname "*.jpg" -type f -exec exiftool -all={} \
By default, exiftool creates new, clean files and saves the originals with “_original” in the file name. Mat2 can only display and remove. The commands
mat2 -s bild.jpg
mat2 bild.jpg
show all readable metadata and remove all metadata. This creates the new file “image.cleaned.jpg”.
See also: Thoroughly delete hard drive data: How to do it under Linux
IDG
To edit metadata, exiftool specifies the necessary parameters before the file name, for example the ISO value of an image with the parameter “-ISO=(value)”. If no value is specified (i.e. a space), this information is deleted, otherwise the new value is entered. The example
exiftool -ISO=200 bild.jpg
Also sets the ISO value to 200. Relative changes with
exiftool -ISO+=50 bild.jpg
are possible. All internal dates can be entered with
exiftool -AllDates="JJJJ:MM:TT HH:MM:SS" bild.jpg
by replacing the representatives with the desired numbers.
The following command adds the CC-BY-SA license to an image and adds the author’s homepage:
exiftool -overwrite_original -XMP-cc:license="http://creativecommons.org/licenses/bysa/4.0/" -XMP-cc:AttributionName="urhebername" -XMP-cc:AttributionURL="http://urheberhomepage.de" bild.jpg
The exiftool also allows you to work with CSV and JSON sources. This allows you to apply metadata changes to an entire folder:
exiftool -csv="/(Pfad)/datei.csv" "/(Pfad)"
This is not always really convenient in the terminal, so we recommend a GUI tool like jExifToolGUI, which is based on exiftool as a graphical front end. This allows you to display the metadata, compare between several images, and copy from one image to another.
Less specialized, but more convenient are the image viewers Subscribe under Gnome-affine desktops, furthermore Digicam under KDE.
Dark table and Gimp Only suitable to a limited extent because they create metadata but cannot edit the information at all or only partially. For music collections, Easytag (available in all package sources) with pre-defined fields specifically for the internal audio metadata.