measure image size using pure Ruby formats: PCX, PSD, XPM, TIFF, XBM, PGM, PBM, PPM, BMP, JPEG, PNG, GIF, SWF
The latest version of image_size can be found at http://github.com/toy/image_size
gem install image_size
ruby "image_size"
ruby "open-uri"
open("http://www.rubycgi.org/image/ruby_gtk_book_title.jpg", "rb") do |fh|
p ImageSize.new(fh.read).size
end
This code is free to use under the terms of the Ruby's licence.
Original author: "Keisuke Minami": mailto:[email protected]