Last active
November 18, 2019 08:23
-
-
Save rharriso/24ab5a77333606e4b468 to your computer and use it in GitHub Desktop.
Paperclip processor for adding copyright info to uploaded files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/paperclip_processors/add_copyright_exif.rb | |
# Requires: | |
# gem paperclip | |
# gem mini_exiftool | |
# exiftool (command line util) | |
module Paperclip | |
class AddCopyrightExif < Paperclip::Processor | |
def make | |
# add exif data | |
f = MiniExiftool.new @file.path | |
f.copyright = "Copyright info here" | |
f.save | |
# return file for future processors | |
@file | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config/environments/production.rb | |
# add exif data to paperclip uploads | |
config.paperclip_defaults = { | |
processors: [:add_copyright_exif], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment