Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Stripping Exif Tags
# Custom filter to run exiftool to strip images of every Exif tag. exiftool
# must be installed separately on the system; the filter assumes a Unix-like
# environment.
class StripExifTagsFilter < Nanoc3::Filter
identifier :strip_exif_tags
type :binary
def run filename, params = {}
tool_present = system 'which exiftool >/dev/null 2>&1'
if tool_present
system "exiftool -q -all= -o #{output_filename} -P #{filename}"
unless $? == 0
raise "Error running exiftool"
end
else
puts "exiftool not found; skipping"
FileUtils.cp filename, output_filename
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.