Create a gist now

Instantly share code, notes, and snippets.

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