No commit activity in last 3 years
No release in over 3 years
Measure following file dimensions: bmp, gif, jpeg, pbm, pcx, pgm, png, ppm, psd, swf, tiff, xbm, xpm
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

image_size

measure image size using pure Ruby formats: bmp, gif, jpeg, pbm, pcx, pgm, png, ppm, psd, swf, tiff, xbm, xpm

Download

The latest version of image_size can be found at http://github.com/toy/image_size

Installation

gem install image_size

Examples

require 'image_size'

p ImageSize.path('spec/test.jpg').size

open('spec/test.jpg', 'rb') do |fh|
  p ImageSize.new(fh).size
end


require 'image_size'
require 'open-uri'

open('http://www.rubycgi.org/image/ruby_gtk_book_title.jpg', 'rb') do |fh|
  p ImageSize.new(fh).size
end

open('http://www.rubycgi.org/image/ruby_gtk_book_title.jpg', 'rb') do |fh|
  data = fh.read
  p ImageSize.new(data).size
end

Licence

This code is free to use under the terms of the Ruby's licence.

Contact

Original author: "Keisuke Minami": mailto:keisuke@rccn.com