DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Scale And Crop Without Caching Temp Image
def scale_crop
.......
# Open the image-file
img = Image.read(picture_name).first
scale_image = img.scale(scale_width,scale_height )
crop_image = scale_image.crop(left_x, left_y, right_x, right_y)
@response.headers["Content-Type"] = "image/jpeg"
render_text do |response|
print crop.to_blob
end
end




