Created
March 13, 2009 10:50
-
-
Save jney/78523 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
# 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