macOS - Converting HEIC to JPG and removing metatdata with one click...
Okay, maybe two clicks. Occasionally I need to upload images to the public Internet and I want to make sure I’m not leaving my location data in these things. Using Automator in macOS, there’s actually an easy way to do this with a Quick Action.
I’m not going to get into the details of creating these, Apple does a decent enough job. But the formula I used to strip metadata is below. Note, there doesn’t seem to be a native method to strip metadata among all of Apple’s image manipulation options in Automator… There is, however, a tool called exiftool which is available in the Homebrew package manager that can do the job for us.
Install Homebrew
This is quite simple, visit brew.sh and read the requirements. You should know what you’re doing here though, it’s a pretty powerful repository and if you’re not already using it… well, use at your own risk.
Install exiftool
brew install exiftool
Once complete, check to see where this was installed with:
which exiftool
/opt/homebrew/bin/exiftool
Create the Workflow
In Automator, click File > New > Quick Action and click Choose
2. Then, click Automatic (files or folder) in any application
3. For Image select whatever icon you want to appear in Finder
4. For Color select whatever color you want
5. Search for “Move Finder Items” and drag that underneath the “Workflow receives” block
6. Select a location to move the files to, I chose Desktop in my example
7. Search for “Change Type of Images”, drag that below “Move Finder Items” and change “To Type” to JPEG
8.Search for “Run AppleScript”, drag it below “Change Type of Images”
9. Finally, paste the following AppleScript below into the new window. Be sure the path to exiftool matches what you found above after installing it from brew.
on run {input, parameters}
repeat with inputfile in input
do shell script "/opt/homebrew/bin/exiftool -overwrite_original -all= " &
quoted form of POSIX path of inputfile
end repeat
end run
End Result
If you followed the above workflow, your .HEIC file should have been moved to the Desktop, converted to a JPEG, and then the offending metadata should now be removed. You can experiment with the different options in exiftool and make other changes (maybe you copy instead of move… I’m not your supervisor!).