It happens that you would like to avoid leaving information about which camera body and lens were used to create a photograph. These data could be removed from EXIF while keeping all the other metadata like location, aperture, shutter speed, etc. – with help of exiftool, a command-line utility to manipulate EXIF.
To make life easier, I created a small service application for macOS available from context menu. You right-click the image and select which information to remove from EXIF:
To have the same thing on your Mac, create an Automator Service named Remove from EXIF….workflow in the following folder:
~/Library/Services
Let it be applicable to image files only or to both files and folders – it′s up to you.
Next, drag-and-drop a Run AppleScript element to Automator window, and paste there the following code:
property preferences_file : "com.pozhvanov.exifcl.plist"
property preferences_path : "~/Library/Preferences/"
property exiftool_path : "/usr/local/bin/exiftool"
property RemoveCameraInfo : "-Make=\"\" -model=\"\""
property RemoveLensInfo : "-Lens=\"\" -LensID=\"\" -FocalLength=\"\" -LensInfo=\"\" -LensSerialNumber=\"\" -LensModel=\"\""
property askForOptions_label : "Please select which type of EXIF record to remove:"
property RemoveCameraInfo_label : "Camera body"
property RemoveLensInfo_label : "Lens"
property RemoveBoth_label : "Both"
property RemoveCancel_label : "Cancel"
to checkPreferences()
tell application "System Events"
if exists file preferences_file of (path to preferences from user domain) then
return 1
else
return 0
end if
end tell
end checkPreferences
to EditEXIF(ImageFile, processOptions)
local ScriptString
set ScriptString to exiftool_path & " -overwrite_original_in_place -P"
if processOptions contains {RemoveCameraInfo_label} or processOptions contains {RemoveBoth_label} then
set ScriptString to ScriptString & " " & RemoveCameraInfo
end if
if processOptions contains {RemoveLensInfo_label} or processOptions contains {RemoveBoth_label} then
set ScriptString to ScriptString & " " & RemoveLensInfo
end if
set ScriptString to ScriptString & " " & "\"" & POSIX path of (ImageFile as text)
& "\""
# display notification ScriptString
do shell script ScriptString
end EditEXIF
to setOptions()
return choose from list {RemoveCameraInfo_label, RemoveLensInfo_label} with title "set options" with prompt "Please select which type of EXIF record to remove:" OK button name "Next" with multiple selections allowed without empty selection allowed
end setOptions
on run {input, parameters}
set def_btn to RemoveCameraInfo_label
(* Read preferences from Preferences File *)
if checkPreferences() is equal to 1 then
set the exifcl_plist to preferences_path & preferences_file
tell application "System Events"
tell property list file exifcl_plist
tell contents
if exists property list item "last_selected_button" then
set def_btn to value of property list item "last_selected_button"
end if
end tell
end tell
end tell
end if
set askForOptions to display dialog askForOptions_label buttons {RemoveCameraInfo_label, RemoveLensInfo_label, RemoveBoth_label} default button def_btn
set processOptions to (button returned of askForOptions)
# set processOptions to setOptions()
if processOptions is not false then
repeat with i in input as list
EditEXIF(i, processOptions)
# display notification i as text with title "Remove EXIF info"
end repeat
end if
tell application "System Events"
set exifcl_dictionary to make new property list item with properties {kind:record}
set exifcl_plist to preferences_path & preferences_file
set this_plist to make new property list file with properties {contents:exifcl_dictionary, name:exifcl_plist}
make new property list item at end of property list items of contents of this_plist
with properties {kind:string, name:"last_selected_button", value:{processOptions}}
end tell
if (count of input) as integer is less than 2 then
display notification "EXIF data were altered in " & ((count of input) as string) & " file." with title "Remove EXIF info"
else
display notification "EXIF data were altered in " & ((count of input) as string) & " files." with title "Remove EXIF info"
end if
end run
- Hibiny and Ladoga lake at Openbank
- Secluded landscapes