Skip to content

Instantly share code, notes, and snippets.

@loganrice
Created September 16, 2015 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loganrice/dc73f3bd33d3c0b48365 to your computer and use it in GitHub Desktop.
Save loganrice/dc73f3bd33d3c0b48365 to your computer and use it in GitHub Desktop.
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