I'm looking for a way to get rid of ALL metadata associated with an image. What should I do?
-
I consider the tags pools of thought that have something to offer. – user3333975 Mar 05 '14 at 22:23
-
Actually, that one is better... – user3333975 Mar 05 '14 at 22:52
3 Answers
A big-hammer approach is jhead's -purejpg option, which, according to the documentation:
Deletes all JPEG sections that aren’t necessary for rendering the image. Strips any metadata that various applications may have left in the image.
This is a cross-platform (Mac, Linux, Windows) command-line program. For example, if you want to remove metadata from a file named "image.jpg" in the current directory, you would run
jhead -purejpg image.jpg
and that is all there is to it.
- 143,140
- 52
- 417
- 741
-
Define "big-hammer", please. I vote for mattdm so far, namely because of your other accounts. – user3333975 Mar 05 '14 at 22:43
-
-
@user3333975 Depends on your operating system. On Fedora,
sudo yum install jhead. On Ubuntu or Debian,sudo apt-get install jhead. On Mac or Windows, you download them from the web site above and put them in your $PATH. If you don't know how to do that, this becomes a question for http://superuser.com/ :) – mattdm Mar 05 '14 at 22:47 -
1Big hammer: it's not very smart and doesn't give you any fine control,but it will definitely smash the metadata. – mattdm Mar 05 '14 at 22:48
-
-
How would I implement it? I mean, perhaps for people visiting this page who want a quick answer you could provide a command line example for an image in the current directory called image.jpg, yeah? – user3333975 Mar 05 '14 at 22:50
Exiftool is able to do this using the -ALL= (see the linked documentation). You can apply better control on this, however, and I would recommend that instead of just deleting all metadata. If you're looking to remove the location information, for example, just use some pattern matching.
- 33,138
- 4
- 72
- 132
-
Oh, no, I want all the data stripped, but yeah I get you with the regex that's easy enough to do if I just pipe it like this or something: exiftool img.jpg | tr 'MASTER PATTERN' '.' – user3333975 Mar 05 '14 at 22:40
I use jpegoptim for stripping metadata:
jpegoptim --strip-all filename
You could also open the image with Gimp and save it without the metadata.
- 101