Created
September 16, 2015 23:22
-
-
Save loganrice/dc73f3bd33d3c0b48365 to your computer and use it in GitHub Desktop.
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
version :thumb do | |
def full_filename(for_file) | |
super(for_file).chomp(File.extname(super(for_file))) + '.jpg' | |
end | |
def convert_thumb_to_jpg | |
manipulate! do |image| | |
image.auto_orient | |
image.format 'jpg' | |
landscape = "75x56" | |
portrait = "56x75" | |
orientation = image[:height] > image[:width] ? portrait : landscape | |
image.resize orientation | |
image | |
end | |
end | |
process :convert_thumb_to_jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment