This question already has an answer here:

I'm looking for a way to get rid of ALL metadata associated with an image. What should I do?

marked as duplicate by mattdm, John Cavan Mar 5 '14 at 22:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I consider the tags pools of thought that have something to offer. – user3333975 Mar 5 '14 at 22:23
  • Actually, that one is better... – user3333975 Mar 5 '14 at 22:52

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.

  • Define "big-hammer", please. I vote for mattdm so far, namely because of your other accounts. – user3333975 Mar 5 '14 at 22:43
  • Hey, mattdm, how do I install this in the terminal? – user3333975 Mar 5 '14 at 22:45
  • @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 superuser.com :) – mattdm Mar 5 '14 at 22:47
  • 1
    Big hammer: it's not very smart and doesn't give you any fine control,but it will definitely smash the metadata. – mattdm Mar 5 '14 at 22:48
  • I see... Well, never mind about the terminal; I've got it. – user3333975 Mar 5 '14 at 22:48

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.

  • 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 5 '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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.