Skip to content

Instantly share code, notes, and snippets.

@baldowl
Created July 24, 2011 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baldowl/1102821 to your computer and use it in GitHub Desktop.
Save baldowl/1102821 to your computer and use it in GitHub Desktop.
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