Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.