ExifTool - How to remove all metadata from all files possible inside a folder and all its subfolders?
Asked Answered
C

1

16

How can I remove all the metadata from all the files inside a folder and its subfolders?

I've already tried several commands without any success. All of them were tied to a specific file extension and/or didn't go through all the subfolders inside.

Chabazite answered 14/2, 2021 at 4:44 Comment(0)
B
28

You would use
exiftool -all:all= -r /path/to/files/

This command creates backup files. Add -overwrite_original to suppress the creation of backup files.

You don't want to use wildcards to try to limit file selection (see Common Mistake #2). For that you would use the -ext (extension) option.

Exiftool won't process any file that isn't on the writable file type list (see ExifTool FAQ #16), so files like AVI or MKV will be skipped.

You do not want to use this command on a RAW file type, such as NEF or CR2, as that will remove data that is required to render the image. See ExifTool FAQ #8.

Beare answered 14/2, 2021 at 7:11 Comment(9)
There are a couple of attributes still being left behind i noticed though.Simplex
Exiftool won't remove the Adobe APP14 block by default as doing so might possibly affect the colors of a jpeg. Nearly anything else that's "left behind" aren't actually embedded data but properties either of the image or the underlying file system.Beare
by default? Is there a nuke option?Simplex
You have to add -Adobe:All= to the command to do so. See note #5 under the -TAG[+-^]=[VALUE] option. But this block contains no personally identifiable data. There's no reason to remove it and, as I said, doing so has the possibility of severely altering the colors. See this exiftool forums post for example images.Beare
Ok, good to know. I think there were still some info like version. But I can live with that I guess. Perhaps thats important.Simplex
Most likely it was ExifToolVersion, which is simply the version of exiftool you're using. It's not embedded in the file. You'll also see File, System, and Composite tags. The first two are properties of the file or the file system, such as image size, file size, permissions, etc. Composite tags don't exist in the file and are created by exiftool on the fly for easy parsing of important data. The command in exiftool FAQ #3 is the best one to use as it will show everything, including duplicates, and their locations.Beare
I also noticed that I got Where from insisting to still stay around. Only worked to remove it by coping to a new file. I could not get rid of it in other ways.Simplex
What is this "Where"? What program are you using to read this "Where" property? Does it show up when you read the file with exiftool? Are you on Windows or Mac? If you are on a Mac and this shows up in Finder, then it probably is either an XAttr or MDItem. These are not embedded in the file but are part of the underlying file system. Exiftool can edit some of these, but there are probably better programs to remove them. Also, because they only exist as part of the file system, then will be removed if you upload the file or transfer to a Windows file system.Beare
Ok, thanks for clarifying. Yes, I am on mac about to send of a file to someone and it had a bunch of info of where I've gotten the file. I have a nuclear bash script with your command on top of it, and did not want to come off. I was able to get it off by copy and paste the folder. Then I guess it lost track of where. It is good if you know these details that they are not part of the file, but info on mac does not give you any hints of what kind of metadata it is so you run the risk it gets passed if you send it off.Simplex

© 2022 - 2024 — McMap. All rights reserved.