Skip to content

Instantly share code, notes, and snippets.

@jney
Created March 13, 2009 10:50
Show Gist options
  • Save jney/78523 to your computer and use it in GitHub Desktop.
Save jney/78523 to your computer and use it in GitHub Desktop.
# get the image width and height for a remote image
require 'rubygems'
require 'open-uri'
require 'RMagick'
class RemoteImage
def initialize(path)
@image = Magick::ImageList.new.from_blob(open(path).read)
end
def height
@image.rows
end
def width
@image.columns
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment