Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Add a watermark to your images upon upload. A sample paperclip processor that builds atop the thumbnailer processor.

License

Notifications You must be signed in to change notification settings

jpmcgrath/paperclip-watermarker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 self.medium_watermark
   File.open(File.join(Rails.root, *%w(public images medium_watermark.png)))
 end

 def self.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.

About

Add a watermark to your images upon upload. A sample paperclip processor that builds atop the thumbnailer processor.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages