Delete all except GPS infomation,but......

Started by dukong, May 19, 2011, 08:03:01 AM

Previous topic - Next topic

dukong

In order to delete all except GPS infomation.
Use this command:
exiftool.exe -all= --gps:all -overwrite_original a.jpg   or   exiftool.exe -all= -a --gps:all -overwrite_original a.jpg
There are some else information(make,modifydate,....) include GPS information in the result, why?
Is there something wrong with my command?

Phil Harvey

There are interdependencies in the metadata.  From the exiftool application documentation:

QuoteJPEG Image:
  - Deleting EXIF or IFD0 also deletes ExifIFD, GlobParamIFD,
    GPS, IFD1, InteropIFD, MakerNotes, PrintIM and SubIFD.
  - Deleting ExifIFD also deletes InteropIFD and MakerNotes.
  - Deleting Photoshop also deletes IPTC.

So if you delete all EXIF, the GPS will get deleted even if you exclude it.

The way to do this is to delete all, then copy back the GPS again.  Some necessary EXIF information will also be generated:

exiftool -all= -tagsfromfile @ -gps:all FILE

You can also copy back any other tags you want to preserve by adding them to the command.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).