Skip to content
Add a watermark to your images upon upload. A sample paperclip processor that builds atop the thumbnailer processor.
Find file
Pull request Compare This branch is 1 commit behind jpmcgrath:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
LICENSE
README.md
Rakefile
paperclip-watermarker.gemspec

README.md

paperclip-watermarker

This gem provides a Paperclip processor and a paperclip-thumbnailer filter for adding watermarks to uploading images in your Rails app.

In your Gemfile:

gem 'paperclip-watermarker'

In your ActiveModel class:

has_attached_file :avatar,
  :styles => {
    :medium => {
      :geometry => '100x100',
      :watermark => medium_watermark },
    :large => {
      :geometry => '300x300',
      :watermark => large_watermark }},
   :processor => [:watermarker]

has_attached_file :abs,
  :styles => {
    :medium => {
      :geometry => '100x100',
      :watermark => medium_watermark },
    :large => {
      :geometry => '300x300',
      :watermark => large_watermark }},
   :processor => [:thumbnailed_watermarker]

 def medium_watermark
   File.open(File.join(Rails.root, *%w(public images medium_watermark.png)))
 end

 def large_watermark
   File.open(File.join(Rails.root, *%w(public images large_watermark.png)))
 end

License and Copyright

Copyright 2011 thoughtbot. Licensed under the MIT license.

Original written by Mike Burns. For support please open a Github Issue.

Something went wrong with that request. Please try again.