Skip to content

Instantly share code, notes, and snippets.

@mchung
Created December 28, 2010 19:02
Show Gist options
  • Save mchung/757557 to your computer and use it in GitHub Desktop.
Save mchung/757557 to your computer and use it in GitHub Desktop.
require "imgscalr-lib" # https://github.com/thebuzzmedia/imgscalr
require "jruby"
java_import "javax.imageio.ImageIO"
ImageIO.write(
com.thebuzzmedia.imgscalr.Scalr.resize(
ImageIO.read(java.io.File.new("iss.jpg")),
250),
"jpg",
java.io.File.new("iss_new.jpg"))
#file = java::io::File.new("iss.jpg")
#imgio = ImageIO.read(java.io.File.new("iss.jpg"))
#io = Scalr.resize(imgio, 150)
#f = java.io.File.new("foo.jpg")
#ImageIO.write(io, "jpg", f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment