No commit activity in last 3 years
No release in over 3 years
This module stores the image files in Redis
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Paperclip Montage

Paperclip Montages aim is to make it easier to create Paperclip avatars for meta models. It is a wrapper for ImageMagick's montage tool.

This was build for Oplerno's online education platform for combining course avatars so they can be displayed as certificate avatars.

Build Status

Installation

gem 'paperclip_montage'
gem install paperclip_montage

Example

This is a simple example in which Meta creates a combined avatar.

class Avatar < ActiveRecord::Base
	has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }

	has_and_belongs_to_many :metas

	validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/
end
class Meta < ActiveRecord::Base
	#after_update :reprocess_montage

	has_and_belongs_to_many :avatars

	has_attached_file :montage,
		processors: [:montage],
		:styles => { medium: { geometry: "300x300>", source: :avatars} , thumb: { geometry: "100x100>" } }

	validates_attachment :montage, :attachment_presence => true,
		:content_type => { :content_type => "image/jpeg" }

	def reprocess_montage
		montage.reprocess!
	end
end

After any changes to the icon for an Avatar the method reprocess_montage must be called on the Meta object.

Acknowledgements

Test image by Matthias Georg - https://www.flickr.com/photos/114805503@N05/15811868778/

Help from these sources: