Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I recursively remove the EXIF info from several thousand JPG files?

share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

The other ExifTool suggestions are great if you want to remove or change specific sections. But if you want to just remove all of the metadata completely, use this (from the man page):

   exiftool -all= dst.jpg
        Delete all meta information from an image.

You could also use jhead, with the -de flag:

   -de    Delete the Exif header entirely.  Leaves  other  metadata
          sections intact.

Note that in both cases, EXIF is only one type of metadata. Other metadata sections may be present, and depending on what you want to do, both of these programs have different options for preserving some or removing it all. For example, jhead -purejpeg strips all information not needed for rendering the image.

share|improve this answer
add comment

Vincent's suggestion of using exiftool is good. I suggest you write a script that accepts a single argument of a filename, and runs your desired strip functions on that. Then use find to execute this script on your file set. The script would look something like this:

#!/bin/sh
exiftool -overwrite_original -ExifFieldName=^ [-MoreExifFieldNames=^] $1

Say you save this as /usr/local/bin/strip_exif.sh, you could then call it by going to the folder that has your jpeg files like this:

find -type f -iname '*.jpg' -exec strip_exif.sh {} \;

Edit: After seeing mattdm's answer about the argument for striping all tags, I figure you can skip the script and just use the find like this:

fine -type f -iname '*.jpg' -exec exiftool -all= {} \;
share|improve this answer
add comment

You should look at some opensource tools like exiftool. There is a lot of option (for exif, xmp, iptc).

exiftool -overwrite_original \
-xmp:Creator='votre nom' \
-xmp:WebStatement='http://creativecommons.org/licenses/by-nc-nd/3.0/' \
-xmp:Rights='Copyright votre nom. This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0  License.' \
-iptc:By-line='votre nom' \
-iptc:CopyrightNotice='Copyright votre nom. This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0  License.' \
-exif:Artist='votre nom' \
-exif:Copyright='Copyright votre nom. This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0  License.' \
votre_fichier.jpg

The only thing you should do next is to write a tiny script that lists your files (jpg) and does the stuff. To remove the content of a field you'll have to set it to " ^" ; like the following example:

-Software= ^
-ModifyDate= ^
-CreatorTool= ^
-MetadataDate= ^
-Rating= ^
-ImageNumber= ^
-WhiteBalance= ^
-Temperature= ^
-Tint= ^
-IncrementalTemperature= ^
-IncrementalTint= ^
-Exposure= ^
-Shadows= ^
-Brightness= ^
-Contrast= ^
-Saturation= ^
-Sharpness= ^
-LuminanceSmoothing= ^
-ColorNoiseReduction= ^
-ChromaticAberrationR= ^
-ChromaticAberrationB= ^
-VignetteAmount= ^
-VignetteMidpoint= ^
-ShadowTint= ^
-RedHue= ^
-RedSaturation= ^-GreenHue= ^
-GreenSaturation= ^
-BlueHue= ^
-BlueSaturation= ^
-FillLight= ^
-Vibrance= ^
-HighlightRecovery= ^
-Clarity= ^
-Defringe= ^
-HueAdjustmentRed= ^
-HueAdjustmentOrange= ^
-HueAdjustmentYellow= ^
-HueAdjustmentGreen= ^
-HueAdjustmentAqua= ^
-HueAdjustmentBlue= ^
-HueAdjustmentPurple= ^
-HueAdjustmentMagenta= ^
-SaturationAdjustmentRed= ^
-SaturationAdjustmentOrange= ^
-SaturationAdjustmentYellow= ^
-SaturationAdjustmentGreen= ^
-SaturationAdjustmentAqua= ^
-SaturationAdjustmentBlue= ^
-SaturationAdjustmentPurple= ^
-SaturationAdjustmentMagenta= ^
-LuminanceAdjustmentRed= ^
-LuminanceAdjustmentOrange= ^
-LuminanceAdjustmentYellow= ^
-LuminanceAdjustmentGreen= ^
-LuminanceAdjustmentAqua= ^
-LuminanceAdjustmentBlue= ^
-LuminanceAdjustmentPurple= ^
-LuminanceAdjustmentMagenta= ^
-SplitToningShadowHue= ^
-SplitToningShadowSaturation= ^
-SplitToningHighlightHue= ^
-SplitToningHighlightSaturation= ^
-SplitToningBalance= ^
-ParametricShadows= ^
-ParametricDarks= ^
-ParametricLights= ^
-ParametricHighlights= ^
-ParametricShadowSplit= ^
-ParametricMidtoneSplit= ^
-ParametricHighlightSplit= ^
-SharpenRadius= ^
-SharpenDetail= ^
-SharpenEdgeMasking= ^
-ConvertToGrayscale= ^
-ToneCurveName= ^
-CameraProfile= ^
-HasSettings= ^
-CropTop= ^
-CropLeft= ^
-CropBottom= ^
-CropRight= ^
-CropAngle= ^
-CropWidth= ^
-CropHeight= ^
-CropUnit= ^
-HasCrop= ^
-AlreadyApplied= ^
-ToneCurve= ^
-CameraProfile= ^
-ApplicationRecordVersion= ^
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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