Created
August 13, 2018 16:10
-
-
Save NaiyaShah-BTC/6841774aff39fc5d3f81a0cd6428e7cc 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
SIZES_ARR = [[167, 200, 'S'], [325, 390, 'M'], [625, 750, 'L']] | |
SIZES_ARR.each do |size_data| | |
resize_image(cropped_img, size_data.first, size_data.second, size_data.last) | |
end | |
def resize_image(image, width, height, size) | |
image.resize_to_fill(width, height).write(Rails.public_path.join("#{size}_#{self.img_file_name}")) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment