Created
January 8, 2017 15:15
-
-
Save ongaeshi/086ffd836292ae4e4143242bae7f8e65 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
DST = 1280 | |
i = Image.pick_from_library | |
puts "src: #{[i.w, i.h]}" | |
if i.w > DST | |
if i.w > i.h | |
j = i.resize(DST, i.h) | |
else | |
j = i.resize(i.w, DST) | |
end | |
puts "dst: #{[j.w, j.h]}" | |
puts j | |
j.save | |
puts "Save to the CameraRoll." | |
else | |
puts "Already width <= #{DST}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment