Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

measure image size using pure Ruby (by Keisuke Minami)

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.markdown
Octocat-spinner-32 image_size.gemspec
README.markdown

image_size

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

Build Status

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

Something went wrong with that request. Please try again.