Fastimage
提供: sha.ngri.la
画像のサイズとタイプを取得する。
インストール
gem install fastimage
使い方
require 'fastimage' FastImage.size("http://stephensykes.com/images/ss.com_x.gif") => [266, 56] # width, height FastImage.type("http://stephensykes.com/images/pngimage") => :png FastImage.type("/some/local/file.gif") => :gif FastImage.size("http://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_1350660_1350692_33_images.jpg", :raise_on_failure=>true, :timeout=>0.1) => FastImage::ImageFetchFailure: FastImage::ImageFetchFailure FastImage.size("http://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_1350660_1350692_33_images.jpg", :raise_on_failure=>true, :timeout=>2.0) => [9545, 6623]