If you upload a photo somewhere, for instance to Flickr as I do, you might not be interested in exposing all the metadata a file contains.
I have started to use the excellent exiftool to manage the metadata exposed on photos that are publicly available.
I came across this excellent webpage, which is a good read.
BEWARE: The example below preserves Artist and CopyRight tags, which might give away your email.
I use this command to remove most metadata. The example modifies the file "test.jpg" to only include a subset of the metadata my photos contain.
exiftool -all:all= \
-tagsfromfile @ \
-ColorSpaceTags \
-ICC_Profile \
-ProfileDecription \
-exif:ExposureTime \
-exif:CreateDate \
-exif:FNumber \
-exif:ImageSize \
-LensId \
-exif:Rights \
-exif:Title \
-exif:FocalLength \
-exif:Subject \
-exif:ISO \
-Exif:Artist \
-Exif:CopyRight \
-Iptc:By-line \
-Xmp-dc:all \
-Xmp-iptcExt:Event \
-Xmp:CreatorTool \
-Exif:Software \
-ProfileDescription test.jpg
Exiftool is also good for adding metadata, like this:
exiftool -Exif:Artist="Per Jensen" test.jpg
# XMP Title
exiftool -Xmp-dc:Title="En title til dette billede" test.jpg
exiftool -Exif:CopyRight="Per Jensen <per2jensen@gmail.com>" test.jpg
# tagging, the -Xmp-dc:Subject field can be used
exiftool -Xmp-dc:Subject="trold sø roskilde" test.jpg
# Tag for "events"
exiftool -Xmp-iptcExt:Event="walk" test.jpg
At some point a I will add something like this to darktable's workflow, that would be very nice.