Created
June 6, 2011 04:41
-
-
Save nthj/1009755 to your computer and use it in GitHub Desktop.
Create thumbnail of provided key, and save it as {key name}_medium.jpg
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
# if "key" equals "bird.jpg", | |
# then this code creates a smaller thumbnail of the bird, | |
# sized to 270 by 167 pixels, | |
# adding a watermark, | |
# compressing the thumbnail to save space, | |
# and saving the new thumbnail as "bird_medium.jpg" | |
Original.find(key).compress(70).resize(270, 167).to(:fit).watermark.save(:medium) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment