imagesize-0.1.1/0000775000175000017500000000000011747461556012210 5ustar sugisugiimagesize-0.1.1/metadata.yml0000664000175000017500000000254211747461556014516 0ustar sugisugi--- !ruby/object:Gem::Specification rubygems_version: 0.9.2 specification_version: 1 name: imagesize version: !ruby/object:Gem::Version version: 0.1.1 date: 2007-05-16 00:00:00 +09:00 summary: measure image size(GIF, PNG, JPEG ,,, etc) require_paths: - lib email: keisuke@rccn.com homepage: http://imagesize.rubyforge.org rubyforge_project: imagesize description: measure image size(GIF, PNG, JPEG ,,, etc) autorequire: default_executable: bindir: bin has_rdoc: true required_ruby_version: !ruby/object:Gem::Version::Requirement requirements: - - ">" - !ruby/object:Gem::Version version: 0.0.0 version: platform: ruby signing_key: cert_chain: post_install_message: authors: - Keisuke Minami files: - Manifest.txt - README.txt - lib/image_size.rb - lib/image_size/version.rb - setup.rb - test/test_helper.rb - test/test_image_size.rb - test/2-4-7.png - test/4_1_2.gif - test/bmp.bmp - test/cursor.xbm - test/detect.swf - test/pbm.pbm - test/pcx.pcx - test/pgm.pgm - test/test.xpm - test/tiff.tiff - test/tokyo_tower.jpg - test/tower_e.gif.psd test_files: - test/test_helper.rb - test/test_image_size.rb rdoc_options: - --quiet - --title - imagesize documentation - --opname - index.html - --line-numbers - --main - README.txt - --inline-source extra_rdoc_files: - README.txt executables: [] extensions: [] requirements: [] dependencies: [] imagesize-0.1.1/test/0000775000175000017500000000000011747461556013167 5ustar sugisugiimagesize-0.1.1/test/tower_e.gif.psd0000644000175000017500000001272411747461556016113 0ustar sugisugi8BPS8BIMHH8BIM x8BIM8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM@@8BIM H HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;.! zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)Km8BIM8BIM ;<JFIFHH&File written by Adobe Photoshop 5.2Adobed            "?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3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>KG!Q; nMO~.%vݽy7}#٬љoicU8wnc?_z\"J,)7?'~; ??#hgoOg}S6?Po"#nO_@_|L_GvFݳ~{~/Si=Qoڶ1 w1IG;}W; 7]ݻY_}{?W=Hk=_նJ7/6I,?oo|V~Io?S#o}_]~}Wh7b7~}߫K_QxJ_~__8BIM XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:q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000241011747461556014667 0ustar sugisugi/* XPM */ static char * sample2_xpm[] = { "32 32 3 1", " c None", ". c #FFFFFF", "+ c #FF0000", "................................", "................................", "................................", "................................", "................................", "................................", "......++..................++....", "......+++................+++....", ".......+++..............+++.....", "........+++............+++......", ".........+++..........+++.......", "..........+++........+++........", "...........+++......+++.........", "............+++....+++..........", ".............+++..+++...........", "..............++++++............", "...............++++.............", "................+++.............", "...............+++++............", "..............+++.+++...........", ".............+++...+++..........", "............+++.....+++.........", "...........+++.......+++........", "..........+++.........+++.......", ".........+++...........+++......", "........+++.............+++.....", ".......+++...............+++....", "......+++.................+++...", "......++...................++...", "................................", "................................", "................................"}; imagesize-0.1.1/test/pgm.pgm0000644000175000017500000001157211747461556014463 0ustar sugisugiP5 #Created with The GIMP 90 55 255 imagesize-0.1.1/test/pcx.pcx0000644000175000017500000000570111747461556014476 0ustar sugisugi E;F6mmm6]N$@]@@]2$]N5h5Q6Q6Q66m]GN]U$G]NGN]9$]N@]2ó5̳5hQm66]G]@+]NU]$N]$]UN556mm]]UN]$@]2+]@9]95hN6Q6]]]N2]GU]N]$h5QQQm]]U2]G+G99]G]@hNQ]9]G2]9]+hNâmQ6]2@]$2]2G]Nh5hh]U29]2U]$hh5â]2+2]2+]U]9hNhhNQQ6]2]G2]GN]$]Uhh5Q6m]+]G2]9+]N@]2NhNhQm6]U]$G]2@]+$]N5hN5QQ]9]G$]$]UG]+55N6QQ]U]NGU]99]9+]G̳N6l6]$N]@U]N]$55¢٢٢2#2$2++2$h5h5hNNh5 imagesize-0.1.1/test/pbm.pbm0000644000175000017500000000117511747461556014447 0ustar sugisugiP4 #Created with The GIMP 85 55 QE" DE DE ""EQEDQU""  "Q Aimagesize-0.1.1/test/detect.swf0000644000175000017500000001070011747461556015154 0ustar sugisugiFWSxe C@?' myMovie.swf_level0!@?? E _SVbN#HJtO'-vK Q t E # _  / 5h|x] }͈fSgٴ ײ8j65hTx+cb7|p<* 5gNf؁N6H3/&iLX>flKq:9Lh5hC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La 0uQI;[IV5'0"&ʹep65k~w\(]9{nKfT0ާma$t>5m0Yo%35gS|뱮8ֺf'ڟYl CflpY*?YM ʆ{ɸٜܬx6Y73V{L W\wll73@ 4FPaehlrsyB[łƂ܂ENW_bhoKvx5` 3fW c$u c( uq1auuu5EAu-5==U]yi]AQIeY}1mE9MA-0?X?xڵ 0&IL|3p'ĝݠTvNj- swY,sF;Ü6NkǬujk5jcpf1L4c~W[>U;UC&MJLܤ}*w)kgkgbh(AgJ/K; rage E4tW?D9X99,+ۉ{:m `:I +wəl-P~/(tӆʵi*%B{."nxd5nlmGS\2e)T t.(p6$9>Ͳ^ؿnv odD-8ҊwBu=S~Ǽơ:^'2,y` Ռ[ o9~Yg(?"px><3.\ N=`9]EHQt,֍Fn]a'"CB#`興4 !W#wG\6⃮*z7n; G<~03/w; -ߤ+;%#nrƂsQtB wDl:Y2\n(A@A@ ( m]Ae:6r ]http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash_blank7 @imagesize-0.1.1/test/cursor.xbm0000644000175000017500000000044211747461556015212 0ustar sugisugi#define cursor_width 16 #define cursor_height 16 static unsigned char cursor_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x84, 0x10, 0xe8, 0x0b, 0x90, 0x04, 0xa8, 0x0a, 0x88, 0x08, 0xfe, 0x3f, 0x88, 0x08, 0xa8, 0x0a, 0x90, 0x04, 0xe8, 0x0b, 0x84, 0x10, 0x80, 0x00, 0x00, 0x00}; imagesize-0.1.1/test/bmp.bmp0000644000175000017500000001674611747461556014461 0ustar sugisugiBM6(22imagesize-0.1.1/test/4_1_2.gif0000644000175000017500000002505211747461556014464 0ustar sugisugiGIF89aƄBAB,s{$kRqބsƄ4{JiBa{Zy9UkB]1M!?CЧ =6\dF:Ҭ$1 I:H­+* q 6ӱ;ŠB5;QH@KUT4@UW]V>lո20ֹi+[m+A\u^C׽Wa9PXb/cLyр5g<i#kL1|Ȼp(2rclp=aW"ߍywz0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l  HR*NRJkiPŧ`nLz`̖m0hU#[q8BBZQ0Ix@B Eg`@H=,HP@Hj) Btx> A5tBuz:|W# p TT*" r vcC ) &X5V}V \T6Us&86`o( @!kE" -;2PIBN:*5SЎ>@KCqŏ$`Ha9| 'bqN XX28vkrdGpԉ)aR щ| '@;wu031^N8<+qT`K@T~1Od:>~(/2Jv}I`qp`LG B$~z|=4g2EiSf^"_Q@ cp B @Fw #*GtEXtSoftware@(#)ImageMagick 5.1.1 00/02/01 Q:8 cristy@mystic.es.dupont.comC2*tEXtSignature26b829313abf3ccb0ff16f6cc5c3d0abB6zIENDB`imagesize-0.1.1/test/test_image_size.rb0000644000175000017500000000303511747461556016666 0ustar sugisugirequire File.dirname(__FILE__) + '/test_helper.rb' class TestImageSize < Test::Unit::TestCase def setup @files = ['4_1_2.gif', '2-4-7.png', 'tokyo_tower.jpg', 'bmp.bmp', 'ppm.ppm', 'pgm.pgm', 'pbm.pbm', 'cursor.xbm', 'tiff.tiff', 'test.xpm', 'tower_e.gif.psd', 'pcx.pcx', 'detect.swf'] @results = [ ['GIF' ,668,481], ['PNG' ,640,532], ['JPEG',320,240], ['BMP' , 50, 50], ['PPM' , 80, 50], ['PGM' , 90, 55], ['PBM' , 85, 55], ['XBM' , 16, 16], ['TIFF', 64, 64], ['XPM' , 32, 32], ['PSD' , 20, 20], ['PCX' , 70, 60], ['SWF' ,450,200], ] end def teardown end def test_0_string # puts "\n" if $VERBOSE @files.each_index do |i| file = @files[i] result = @results[i] open("test/#{file}", "rb") do |fh| img_data = fh.read # puts "file =#{file}" if $VERBOSE img = ImageSize.new(img_data, result[0]) assert_equal(result[1], img.get_width) assert_equal(result[2], img.get_height) img = ImageSize.new(img_data) assert_equal(result[0], img.get_type) assert_equal(result[1], img.get_width) assert_equal(result[2], img.get_height) end end end def test_1_io # puts "\n" if $VERBOSE @files.each_index do |i| file = @files[i] result = @results[i] open("test/#{file}", "rb") do |fh| # puts "file =#{file}" if $VERBOSE img = ImageSize.new(fh) assert_equal(result[0], img.get_type) assert_equal(result[1], img.get_width) assert_equal(result[2], img.get_height) end end end end imagesize-0.1.1/test/test_helper.rb0000644000175000017500000000011211747461556016022 0ustar sugisugirequire 'test/unit' require File.dirname(__FILE__) + '/../lib/image_size' imagesize-0.1.1/setup.rb0000644000175000017500000010650211747461556013677 0ustar sugisugi# # setup.rb # # Copyright (c) 2000-2005 Minero Aoki # # This program is free software. # You can distribute/modify this program under the terms of # the GNU LGPL, Lesser General Public License version 2.1. # unless Enumerable.method_defined?(:map) # Ruby 1.4.6 module Enumerable alias map collect end end unless File.respond_to?(:read) # Ruby 1.6 def File.read(fname) open(fname) {|f| return f.read } end end unless Errno.const_defined?(:ENOTEMPTY) # Windows? module Errno class ENOTEMPTY # We do not raise this exception, implementation is not needed. end end end def File.binread(fname) open(fname, 'rb') {|f| return f.read } end # for corrupted Windows' stat(2) def File.dir?(path) File.directory?((path[-1,1] == '/') ? path : path + '/') end class ConfigTable include Enumerable def initialize(rbconfig) @rbconfig = rbconfig @items = [] @table = {} # options @install_prefix = nil @config_opt = nil @verbose = true @no_harm = false end attr_accessor :install_prefix attr_accessor :config_opt attr_writer :verbose def verbose? @verbose end attr_writer :no_harm def no_harm? @no_harm end def [](key) lookup(key).resolve(self) end def []=(key, val) lookup(key).set val end def names @items.map {|i| i.name } end def each(&block) @items.each(&block) end def key?(name) @table.key?(name) end def lookup(name) @table[name] or setup_rb_error "no such config item: #{name}" end def add(item) @items.push item @table[item.name] = item end def remove(name) item = lookup(name) @items.delete_if {|i| i.name == name } @table.delete_if {|name, i| i.name == name } item end def load_script(path, inst = nil) if File.file?(path) MetaConfigEnvironment.new(self, inst).instance_eval File.read(path), path end end def savefile '.config' end def load_savefile begin File.foreach(savefile()) do |line| k, v = *line.split(/=/, 2) self[k] = v.strip end rescue Errno::ENOENT setup_rb_error $!.message + "\n#{File.basename($0)} config first" end end def save @items.each {|i| i.value } File.open(savefile(), 'w') {|f| @items.each do |i| f.printf "%s=%s\n", i.name, i.value if i.value? and i.value end } end def load_standard_entries standard_entries(@rbconfig).each do |ent| add ent end end def standard_entries(rbconfig) c = rbconfig rubypath = File.join(c['bindir'], c['ruby_install_name'] + c['EXEEXT']) major = c['MAJOR'].to_i minor = c['MINOR'].to_i teeny = c['TEENY'].to_i version = "#{major}.#{minor}" # ruby ver. >= 1.4.4? newpath_p = ((major >= 2) or ((major == 1) and ((minor >= 5) or ((minor == 4) and (teeny >= 4))))) if c['rubylibdir'] # V > 1.6.3 libruby = "#{c['prefix']}/lib/ruby" librubyver = c['rubylibdir'] librubyverarch = c['archdir'] siteruby = c['sitedir'] siterubyver = c['sitelibdir'] siterubyverarch = c['sitearchdir'] elsif newpath_p # 1.4.4 <= V <= 1.6.3 libruby = "#{c['prefix']}/lib/ruby" librubyver = "#{c['prefix']}/lib/ruby/#{version}" librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}" siteruby = c['sitedir'] siterubyver = "$siteruby/#{version}" siterubyverarch = "$siterubyver/#{c['arch']}" else # V < 1.4.4 libruby = "#{c['prefix']}/lib/ruby" librubyver = "#{c['prefix']}/lib/ruby/#{version}" librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}" siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby" siterubyver = siteruby siterubyverarch = "$siterubyver/#{c['arch']}" end parameterize = lambda {|path| path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix') } if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg } makeprog = arg.sub(/'/, '').split(/=/, 2)[1] else makeprog = 'make' end [ ExecItem.new('installdirs', 'std/site/home', 'std: install under libruby; site: install under site_ruby; home: install under $HOME')\ {|val, table| case val when 'std' table['rbdir'] = '$librubyver' table['sodir'] = '$librubyverarch' when 'site' table['rbdir'] = '$siterubyver' table['sodir'] = '$siterubyverarch' when 'home' setup_rb_error '$HOME was not set' unless ENV['HOME'] table['prefix'] = ENV['HOME'] table['rbdir'] = '$libdir/ruby' table['sodir'] = '$libdir/ruby' end }, PathItem.new('prefix', 'path', c['prefix'], 'path prefix of target environment'), PathItem.new('bindir', 'path', parameterize.call(c['bindir']), 'the directory for commands'), PathItem.new('libdir', 'path', parameterize.call(c['libdir']), 'the directory for libraries'), PathItem.new('datadir', 'path', parameterize.call(c['datadir']), 'the directory for shared data'), PathItem.new('mandir', 'path', parameterize.call(c['mandir']), 'the directory for man pages'), PathItem.new('sysconfdir', 'path', parameterize.call(c['sysconfdir']), 'the directory for system configuration files'), PathItem.new('localstatedir', 'path', parameterize.call(c['localstatedir']), 'the directory for local state data'), PathItem.new('libruby', 'path', libruby, 'the directory for ruby libraries'), PathItem.new('librubyver', 'path', librubyver, 'the directory for standard ruby libraries'), PathItem.new('librubyverarch', 'path', librubyverarch, 'the directory for standard ruby extensions'), PathItem.new('siteruby', 'path', siteruby, 'the directory for version-independent aux ruby libraries'), PathItem.new('siterubyver', 'path', siterubyver, 'the directory for aux ruby libraries'), PathItem.new('siterubyverarch', 'path', siterubyverarch, 'the directory for aux ruby binaries'), PathItem.new('rbdir', 'path', '$siterubyver', 'the directory for ruby scripts'), PathItem.new('sodir', 'path', '$siterubyverarch', 'the directory for ruby extentions'), PathItem.new('rubypath', 'path', rubypath, 'the path to set to #! line'), ProgramItem.new('rubyprog', 'name', rubypath, 'the ruby program using for installation'), ProgramItem.new('makeprog', 'name', makeprog, 'the make program to compile ruby extentions'), SelectItem.new('shebang', 'all/ruby/never', 'ruby', 'shebang line (#!) editing mode'), BoolItem.new('without-ext', 'yes/no', 'no', 'does not compile/install ruby extentions') ] end private :standard_entries def load_multipackage_entries multipackage_entries().each do |ent| add ent end end def multipackage_entries [ PackageSelectionItem.new('with', 'name,name...', '', 'ALL', 'package names that you want to install'), PackageSelectionItem.new('without', 'name,name...', '', 'NONE', 'package names that you do not want to install') ] end private :multipackage_entries ALIASES = { 'std-ruby' => 'librubyver', 'stdruby' => 'librubyver', 'rubylibdir' => 'librubyver', 'archdir' => 'librubyverarch', 'site-ruby-common' => 'siteruby', # For backward compatibility 'site-ruby' => 'siterubyver', # For backward compatibility 'bin-dir' => 'bindir', 'bin-dir' => 'bindir', 'rb-dir' => 'rbdir', 'so-dir' => 'sodir', 'data-dir' => 'datadir', 'ruby-path' => 'rubypath', 'ruby-prog' => 'rubyprog', 'ruby' => 'rubyprog', 'make-prog' => 'makeprog', 'make' => 'makeprog' } def fixup ALIASES.each do |ali, name| @table[ali] = @table[name] end @items.freeze @table.freeze @options_re = /\A--(#{@table.keys.join('|')})(?:=(.*))?\z/ end def parse_opt(opt) m = @options_re.match(opt) or setup_rb_error "config: unknown option #{opt}" m.to_a[1,2] end def dllext @rbconfig['DLEXT'] end def value_config?(name) lookup(name).value? end class Item def initialize(name, template, default, desc) @name = name.freeze @template = template @value = default @default = default @description = desc end attr_reader :name attr_reader :description attr_accessor :default alias help_default default def help_opt "--#{@name}=#{@template}" end def value? true end def value @value end def resolve(table) @value.gsub(%r<\$([^/]+)>) { table[$1] } end def set(val) @value = check(val) end private def check(val) setup_rb_error "config: --#{name} requires argument" unless val val end end class BoolItem < Item def config_type 'bool' end def help_opt "--#{@name}" end private def check(val) return 'yes' unless val case val when /\Ay(es)?\z/i, /\At(rue)?\z/i then 'yes' when /\An(o)?\z/i, /\Af(alse)\z/i then 'no' else setup_rb_error "config: --#{@name} accepts only yes/no for argument" end end end class PathItem < Item def config_type 'path' end private def check(path) setup_rb_error "config: --#{@name} requires argument" unless path path[0,1] == '$' ? path : File.expand_path(path) end end class ProgramItem < Item def config_type 'program' end end class SelectItem < Item def initialize(name, selection, default, desc) super @ok = selection.split('/') end def config_type 'select' end private def check(val) unless @ok.include?(val.strip) setup_rb_error "config: use --#{@name}=#{@template} (#{val})" end val.strip end end class ExecItem < Item def initialize(name, selection, desc, &block) super name, selection, nil, desc @ok = selection.split('/') @action = block end def config_type 'exec' end def value? false end def resolve(table) setup_rb_error "$#{name()} wrongly used as option value" end undef set def evaluate(val, table) v = val.strip.downcase unless @ok.include?(v) setup_rb_error "invalid option --#{@name}=#{val} (use #{@template})" end @action.call v, table end end class PackageSelectionItem < Item def initialize(name, template, default, help_default, desc) super name, template, default, desc @help_default = help_default end attr_reader :help_default def config_type 'package' end private def check(val) unless File.dir?("packages/#{val}") setup_rb_error "config: no such package: #{val}" end val end end class MetaConfigEnvironment def initialize(config, installer) @config = config @installer = installer end def config_names @config.names end def config?(name) @config.key?(name) end def bool_config?(name) @config.lookup(name).config_type == 'bool' end def path_config?(name) @config.lookup(name).config_type == 'path' end def value_config?(name) @config.lookup(name).config_type != 'exec' end def add_config(item) @config.add item end def add_bool_config(name, default, desc) @config.add BoolItem.new(name, 'yes/no', default ? 'yes' : 'no', desc) end def add_path_config(name, default, desc) @config.add PathItem.new(name, 'path', default, desc) end def set_config_default(name, default) @config.lookup(name).default = default end def remove_config(name) @config.remove(name) end # For only multipackage def packages raise '[setup.rb fatal] multi-package metaconfig API packages() called for single-package; contact application package vendor' unless @installer @installer.packages end # For only multipackage def declare_packages(list) raise '[setup.rb fatal] multi-package metaconfig API declare_packages() called for single-package; contact application package vendor' unless @installer @installer.packages = list end end end # class ConfigTable # This module requires: #verbose?, #no_harm? module FileOperations def mkdir_p(dirname, prefix = nil) dirname = prefix + File.expand_path(dirname) if prefix $stderr.puts "mkdir -p #{dirname}" if verbose? return if no_harm? # Does not check '/', it's too abnormal. dirs = File.expand_path(dirname).split(%r<(?=/)>) if /\A[a-z]:\z/i =~ dirs[0] disk = dirs.shift dirs[0] = disk + dirs[0] end dirs.each_index do |idx| path = dirs[0..idx].join('') Dir.mkdir path unless File.dir?(path) end end def rm_f(path) $stderr.puts "rm -f #{path}" if verbose? return if no_harm? force_remove_file path end def rm_rf(path) $stderr.puts "rm -rf #{path}" if verbose? return if no_harm? remove_tree path end def remove_tree(path) if File.symlink?(path) remove_file path elsif File.dir?(path) remove_tree0 path else force_remove_file path end end def remove_tree0(path) Dir.foreach(path) do |ent| next if ent == '.' next if ent == '..' entpath = "#{path}/#{ent}" if File.symlink?(entpath) remove_file entpath elsif File.dir?(entpath) remove_tree0 entpath else force_remove_file entpath end end begin Dir.rmdir path rescue Errno::ENOTEMPTY # directory may not be empty end end def move_file(src, dest) force_remove_file dest begin File.rename src, dest rescue File.open(dest, 'wb') {|f| f.write File.binread(src) } File.chmod File.stat(src).mode, dest File.unlink src end end def force_remove_file(path) begin remove_file path rescue end end def remove_file(path) File.chmod 0777, path File.unlink path end def install(from, dest, mode, prefix = nil) $stderr.puts "install #{from} #{dest}" if verbose? return if no_harm? realdest = prefix ? prefix + File.expand_path(dest) : dest realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest) str = File.binread(from) if diff?(str, realdest) verbose_off { rm_f realdest if File.exist?(realdest) } File.open(realdest, 'wb') {|f| f.write str } File.chmod mode, realdest File.open("#{objdir_root()}/InstalledFiles", 'a') {|f| if prefix f.puts realdest.sub(prefix, '') else f.puts realdest end } end end def diff?(new_content, path) return true unless File.exist?(path) new_content != File.binread(path) end def command(*args) $stderr.puts args.join(' ') if verbose? system(*args) or raise RuntimeError, "system(#{args.map{|a| a.inspect }.join(' ')}) failed" end def ruby(*args) command config('rubyprog'), *args end def make(task = nil) command(*[config('makeprog'), task].compact) end def extdir?(dir) File.exist?("#{dir}/MANIFEST") or File.exist?("#{dir}/extconf.rb") end def files_of(dir) Dir.open(dir) {|d| return d.select {|ent| File.file?("#{dir}/#{ent}") } } end DIR_REJECT = %w( . .. CVS SCCS RCS CVS.adm .svn ) def directories_of(dir) Dir.open(dir) {|d| return d.select {|ent| File.dir?("#{dir}/#{ent}") } - DIR_REJECT } end end # This module requires: #srcdir_root, #objdir_root, #relpath module HookScriptAPI def get_config(key) @config[key] end alias config get_config # obsolete: use metaconfig to change configuration def set_config(key, val) @config[key] = val end # # srcdir/objdir (works only in the package directory) # def curr_srcdir "#{srcdir_root()}/#{relpath()}" end def curr_objdir "#{objdir_root()}/#{relpath()}" end def srcfile(path) "#{curr_srcdir()}/#{path}" end def srcexist?(path) File.exist?(srcfile(path)) end def srcdirectory?(path) File.dir?(srcfile(path)) end def srcfile?(path) File.file?(srcfile(path)) end def srcentries(path = '.') Dir.open("#{curr_srcdir()}/#{path}") {|d| return d.to_a - %w(. ..) } end def srcfiles(path = '.') srcentries(path).select {|fname| File.file?(File.join(curr_srcdir(), path, fname)) } end def srcdirectories(path = '.') srcentries(path).select {|fname| File.dir?(File.join(curr_srcdir(), path, fname)) } end end class ToplevelInstaller Version = '3.4.1' Copyright = 'Copyright (c) 2000-2005 Minero Aoki' TASKS = [ [ 'all', 'do config, setup, then install' ], [ 'config', 'saves your configurations' ], [ 'show', 'shows current configuration' ], [ 'setup', 'compiles ruby extentions and others' ], [ 'install', 'installs files' ], [ 'test', 'run all tests in test/' ], [ 'clean', "does `make clean' for each extention" ], [ 'distclean',"does `make distclean' for each extention" ] ] def ToplevelInstaller.invoke config = ConfigTable.new(load_rbconfig()) config.load_standard_entries config.load_multipackage_entries if multipackage? config.fixup klass = (multipackage?() ? ToplevelInstallerMulti : ToplevelInstaller) klass.new(File.dirname($0), config).invoke end def ToplevelInstaller.multipackage? File.dir?(File.dirname($0) + '/packages') end def ToplevelInstaller.load_rbconfig if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg } ARGV.delete(arg) load File.expand_path(arg.split(/=/, 2)[1]) $".push 'rbconfig.rb' else require 'rbconfig' end ::Config::CONFIG end def initialize(ardir_root, config) @ardir = File.expand_path(ardir_root) @config = config # cache @valid_task_re = nil end def config(key) @config[key] end def inspect "#<#{self.class} #{__id__()}>" end def invoke run_metaconfigs case task = parsearg_global() when nil, 'all' parsearg_config init_installers exec_config exec_setup exec_install else case task when 'config', 'test' ; when 'clean', 'distclean' @config.load_savefile if File.exist?(@config.savefile) else @config.load_savefile end __send__ "parsearg_#{task}" init_installers __send__ "exec_#{task}" end end def run_metaconfigs @config.load_script "#{@ardir}/metaconfig" end def init_installers @installer = Installer.new(@config, @ardir, File.expand_path('.')) end # # Hook Script API bases # def srcdir_root @ardir end def objdir_root '.' end def relpath '.' end # # Option Parsing # def parsearg_global while arg = ARGV.shift case arg when /\A\w+\z/ setup_rb_error "invalid task: #{arg}" unless valid_task?(arg) return arg when '-q', '--quiet' @config.verbose = false when '--verbose' @config.verbose = true when '--help' print_usage $stdout exit 0 when '--version' puts "#{File.basename($0)} version #{Version}" exit 0 when '--copyright' puts Copyright exit 0 else setup_rb_error "unknown global option '#{arg}'" end end nil end def valid_task?(t) valid_task_re() =~ t end def valid_task_re @valid_task_re ||= /\A(?:#{TASKS.map {|task,desc| task }.join('|')})\z/ end def parsearg_no_options unless ARGV.empty? task = caller(0).first.slice(%r<`parsearg_(\w+)'>, 1) setup_rb_error "#{task}: unknown options: #{ARGV.join(' ')}" end end alias parsearg_show parsearg_no_options alias parsearg_setup parsearg_no_options alias parsearg_test parsearg_no_options alias parsearg_clean parsearg_no_options alias parsearg_distclean parsearg_no_options def parsearg_config evalopt = [] set = [] @config.config_opt = [] while i = ARGV.shift if /\A--?\z/ =~ i @config.config_opt = ARGV.dup break end name, value = *@config.parse_opt(i) if @config.value_config?(name) @config[name] = value else evalopt.push [name, value] end set.push name end evalopt.each do |name, value| @config.lookup(name).evaluate value, @config end # Check if configuration is valid set.each do |n| @config[n] if @config.value_config?(n) end end def parsearg_install @config.no_harm = false @config.install_prefix = '' while a = ARGV.shift case a when '--no-harm' @config.no_harm = true when /\A--prefix=/ path = a.split(/=/, 2)[1] path = File.expand_path(path) unless path[0,1] == '/' @config.install_prefix = path else setup_rb_error "install: unknown option #{a}" end end end def print_usage(out) out.puts 'Typical Installation Procedure:' out.puts " $ ruby #{File.basename $0} config" out.puts " $ ruby #{File.basename $0} setup" out.puts " # ruby #{File.basename $0} install (may require root privilege)" out.puts out.puts 'Detailed Usage:' out.puts " ruby #{File.basename $0} " out.puts " ruby #{File.basename $0} [] []" fmt = " %-24s %s\n" out.puts out.puts 'Global options:' out.printf fmt, '-q,--quiet', 'suppress message outputs' out.printf fmt, ' --verbose', 'output messages verbosely' out.printf fmt, ' --help', 'print this message' out.printf fmt, ' --version', 'print version and quit' out.printf fmt, ' --copyright', 'print copyright and quit' out.puts out.puts 'Tasks:' TASKS.each do |name, desc| out.printf fmt, name, desc end fmt = " %-24s %s [%s]\n" out.puts out.puts 'Options for CONFIG or ALL:' @config.each do |item| out.printf fmt, item.help_opt, item.description, item.help_default end out.printf fmt, '--rbconfig=path', 'rbconfig.rb to load',"running ruby's" out.puts out.puts 'Options for INSTALL:' out.printf fmt, '--no-harm', 'only display what to do if given', 'off' out.printf fmt, '--prefix=path', 'install path prefix', '' out.puts end # # Task Handlers # def exec_config @installer.exec_config @config.save # must be final end def exec_setup @installer.exec_setup end def exec_install @installer.exec_install end def exec_test @installer.exec_test end def exec_show @config.each do |i| printf "%-20s %s\n", i.name, i.value if i.value? end end def exec_clean @installer.exec_clean end def exec_distclean @installer.exec_distclean end end # class ToplevelInstaller class ToplevelInstallerMulti < ToplevelInstaller include FileOperations def initialize(ardir_root, config) super @packages = directories_of("#{@ardir}/packages") raise 'no package exists' if @packages.empty? @root_installer = Installer.new(@config, @ardir, File.expand_path('.')) end def run_metaconfigs @config.load_script "#{@ardir}/metaconfig", self @packages.each do |name| @config.load_script "#{@ardir}/packages/#{name}/metaconfig" end end attr_reader :packages def packages=(list) raise 'package list is empty' if list.empty? list.each do |name| raise "directory packages/#{name} does not exist"\ unless File.dir?("#{@ardir}/packages/#{name}") end @packages = list end def init_installers @installers = {} @packages.each do |pack| @installers[pack] = Installer.new(@config, "#{@ardir}/packages/#{pack}", "packages/#{pack}") end with = extract_selection(config('with')) without = extract_selection(config('without')) @selected = @installers.keys.select {|name| (with.empty? or with.include?(name)) \ and not without.include?(name) } end def extract_selection(list) a = list.split(/,/) a.each do |name| setup_rb_error "no such package: #{name}" unless @installers.key?(name) end a end def print_usage(f) super f.puts 'Inluded packages:' f.puts ' ' + @packages.sort.join(' ') f.puts end # # Task Handlers # def exec_config run_hook 'pre-config' each_selected_installers {|inst| inst.exec_config } run_hook 'post-config' @config.save # must be final end def exec_setup run_hook 'pre-setup' each_selected_installers {|inst| inst.exec_setup } run_hook 'post-setup' end def exec_install run_hook 'pre-install' each_selected_installers {|inst| inst.exec_install } run_hook 'post-install' end def exec_test run_hook 'pre-test' each_selected_installers {|inst| inst.exec_test } run_hook 'post-test' end def exec_clean rm_f @config.savefile run_hook 'pre-clean' each_selected_installers {|inst| inst.exec_clean } run_hook 'post-clean' end def exec_distclean rm_f @config.savefile run_hook 'pre-distclean' each_selected_installers {|inst| inst.exec_distclean } run_hook 'post-distclean' end # # lib # def each_selected_installers Dir.mkdir 'packages' unless File.dir?('packages') @selected.each do |pack| $stderr.puts "Processing the package `#{pack}' ..." if verbose? Dir.mkdir "packages/#{pack}" unless File.dir?("packages/#{pack}") Dir.chdir "packages/#{pack}" yield @installers[pack] Dir.chdir '../..' end end def run_hook(id) @root_installer.run_hook id end # module FileOperations requires this def verbose? @config.verbose? end # module FileOperations requires this def no_harm? @config.no_harm? end end # class ToplevelInstallerMulti class Installer FILETYPES = %w( bin lib ext data conf man ) include FileOperations include HookScriptAPI def initialize(config, srcroot, objroot) @config = config @srcdir = File.expand_path(srcroot) @objdir = File.expand_path(objroot) @currdir = '.' end def inspect "#<#{self.class} #{File.basename(@srcdir)}>" end def noop(rel) end # # Hook Script API base methods # def srcdir_root @srcdir end def objdir_root @objdir end def relpath @currdir end # # Config Access # # module FileOperations requires this def verbose? @config.verbose? end # module FileOperations requires this def no_harm? @config.no_harm? end def verbose_off begin save, @config.verbose = @config.verbose?, false yield ensure @config.verbose = save end end # # TASK config # def exec_config exec_task_traverse 'config' end alias config_dir_bin noop alias config_dir_lib noop def config_dir_ext(rel) extconf if extdir?(curr_srcdir()) end alias config_dir_data noop alias config_dir_conf noop alias config_dir_man noop def extconf ruby "#{curr_srcdir()}/extconf.rb", *@config.config_opt end # # TASK setup # def exec_setup exec_task_traverse 'setup' end def setup_dir_bin(rel) files_of(curr_srcdir()).each do |fname| update_shebang_line "#{curr_srcdir()}/#{fname}" end end alias setup_dir_lib noop def setup_dir_ext(rel) make if extdir?(curr_srcdir()) end alias setup_dir_data noop alias setup_dir_conf noop alias setup_dir_man noop def update_shebang_line(path) return if no_harm? return if config('shebang') == 'never' old = Shebang.load(path) if old $stderr.puts "warning: #{path}: Shebang line includes too many args. It is not portable and your program may not work." if old.args.size > 1 new = new_shebang(old) return if new.to_s == old.to_s else return unless config('shebang') == 'all' new = Shebang.new(config('rubypath')) end $stderr.puts "updating shebang: #{File.basename(path)}" if verbose? open_atomic_writer(path) {|output| File.open(path, 'rb') {|f| f.gets if old # discard output.puts new.to_s output.print f.read } } end def new_shebang(old) if /\Aruby/ =~ File.basename(old.cmd) Shebang.new(config('rubypath'), old.args) elsif File.basename(old.cmd) == 'env' and old.args.first == 'ruby' Shebang.new(config('rubypath'), old.args[1..-1]) else return old unless config('shebang') == 'all' Shebang.new(config('rubypath')) end end def open_atomic_writer(path, &block) tmpfile = File.basename(path) + '.tmp' begin File.open(tmpfile, 'wb', &block) File.rename tmpfile, File.basename(path) ensure File.unlink tmpfile if File.exist?(tmpfile) end end class Shebang def Shebang.load(path) line = nil File.open(path) {|f| line = f.gets } return nil unless /\A#!/ =~ line parse(line) end def Shebang.parse(line) cmd, *args = *line.strip.sub(/\A\#!/, '').split(' ') new(cmd, args) end def initialize(cmd, args = []) @cmd = cmd @args = args end attr_reader :cmd attr_reader :args def to_s "#! #{@cmd}" + (@args.empty? ? '' : " #{@args.join(' ')}") end end # # TASK install # def exec_install rm_f 'InstalledFiles' exec_task_traverse 'install' end def install_dir_bin(rel) install_files targetfiles(), "#{config('bindir')}/#{rel}", 0755 end def install_dir_lib(rel) install_files libfiles(), "#{config('rbdir')}/#{rel}", 0644 end def install_dir_ext(rel) return unless extdir?(curr_srcdir()) install_files rubyextentions('.'), "#{config('sodir')}/#{File.dirname(rel)}", 0555 end def install_dir_data(rel) install_files targetfiles(), "#{config('datadir')}/#{rel}", 0644 end def install_dir_conf(rel) # FIXME: should not remove current config files # (rename previous file to .old/.org) install_files targetfiles(), "#{config('sysconfdir')}/#{rel}", 0644 end def install_dir_man(rel) install_files targetfiles(), "#{config('mandir')}/#{rel}", 0644 end def install_files(list, dest, mode) mkdir_p dest, @config.install_prefix list.each do |fname| install fname, dest, mode, @config.install_prefix end end def libfiles glob_reject(%w(*.y *.output), targetfiles()) end def rubyextentions(dir) ents = glob_select("*.#{@config.dllext}", targetfiles()) if ents.empty? setup_rb_error "no ruby extention exists: 'ruby #{$0} setup' first" end ents end def targetfiles mapdir(existfiles() - hookfiles()) end def mapdir(ents) ents.map {|ent| if File.exist?(ent) then ent # objdir else "#{curr_srcdir()}/#{ent}" # srcdir end } end # picked up many entries from cvs-1.11.1/src/ignore.c JUNK_FILES = %w( core RCSLOG tags TAGS .make.state .nse_depinfo #* .#* cvslog.* ,* .del-* *.olb *~ *.old *.bak *.BAK *.orig *.rej _$* *$ *.org *.in .* ) def existfiles glob_reject(JUNK_FILES, (files_of(curr_srcdir()) | files_of('.'))) end def hookfiles %w( pre-%s post-%s pre-%s.rb post-%s.rb ).map {|fmt| %w( config setup install clean ).map {|t| sprintf(fmt, t) } }.flatten end def glob_select(pat, ents) re = globs2re([pat]) ents.select {|ent| re =~ ent } end def glob_reject(pats, ents) re = globs2re(pats) ents.reject {|ent| re =~ ent } end GLOB2REGEX = { '.' => '\.', '$' => '\$', '#' => '\#', '*' => '.*' } def globs2re(pats) /\A(?:#{ pats.map {|pat| pat.gsub(/[\.\$\#\*]/) {|ch| GLOB2REGEX[ch] } }.join('|') })\z/ end # # TASK test # TESTDIR = 'test' def exec_test unless File.directory?('test') $stderr.puts 'no test in this package' if verbose? return end $stderr.puts 'Running tests...' if verbose? begin require 'test/unit' rescue LoadError setup_rb_error 'test/unit cannot loaded. You need Ruby 1.8 or later to invoke this task.' end runner = Test::Unit::AutoRunner.new(true) runner.to_run << TESTDIR runner.run end # # TASK clean # def exec_clean exec_task_traverse 'clean' rm_f @config.savefile rm_f 'InstalledFiles' end alias clean_dir_bin noop alias clean_dir_lib noop alias clean_dir_data noop alias clean_dir_conf noop alias clean_dir_man noop def clean_dir_ext(rel) return unless extdir?(curr_srcdir()) make 'clean' if File.file?('Makefile') end # # TASK distclean # def exec_distclean exec_task_traverse 'distclean' rm_f @config.savefile rm_f 'InstalledFiles' end alias distclean_dir_bin noop alias distclean_dir_lib noop def distclean_dir_ext(rel) return unless extdir?(curr_srcdir()) make 'distclean' if File.file?('Makefile') end alias distclean_dir_data noop alias distclean_dir_conf noop alias distclean_dir_man noop # # Traversing # def exec_task_traverse(task) run_hook "pre-#{task}" FILETYPES.each do |type| if type == 'ext' and config('without-ext') == 'yes' $stderr.puts 'skipping ext/* by user option' if verbose? next end traverse task, type, "#{task}_dir_#{type}" end run_hook "post-#{task}" end def traverse(task, rel, mid) dive_into(rel) { run_hook "pre-#{task}" __send__ mid, rel.sub(%r[\A.*?(?:/|\z)], '') directories_of(curr_srcdir()).each do |d| traverse task, "#{rel}/#{d}", mid end run_hook "post-#{task}" } end def dive_into(rel) return unless File.dir?("#{@srcdir}/#{rel}") dir = File.basename(rel) Dir.mkdir dir unless File.dir?(dir) prevdir = Dir.pwd Dir.chdir dir $stderr.puts '---> ' + rel if verbose? @currdir = rel yield Dir.chdir prevdir $stderr.puts '<--- ' + rel if verbose? @currdir = File.dirname(rel) end def run_hook(id) path = [ "#{curr_srcdir()}/#{id}", "#{curr_srcdir()}/#{id}.rb" ].detect {|cand| File.file?(cand) } return unless path begin instance_eval File.read(path), path, 1 rescue raise if $DEBUG setup_rb_error "hook #{path} failed:\n" + $!.message end end end # class Installer class SetupError < StandardError; end def setup_rb_error(msg) raise SetupError, msg end if $0 == __FILE__ begin ToplevelInstaller.invoke rescue SetupError raise if $DEBUG $stderr.puts $!.message $stderr.puts "Try 'ruby #{$0} --help' for detailed usage." exit 1 end end imagesize-0.1.1/lib/0000775000175000017500000000000011747461556012756 5ustar sugisugiimagesize-0.1.1/lib/image_size/0000775000175000017500000000000011747461556015072 5ustar sugisugiimagesize-0.1.1/lib/image_size/version.rb0000644000175000017500000000023611747461556017103 0ustar sugisugimodule Imagesize #:nodoc: module VERSION #:nodoc: MAJOR = 0 MINOR = 1 TINY = 1 STRING = [MAJOR, MINOR, TINY].join('.') end end imagesize-0.1.1/lib/image_size.rb0000644000175000017500000002106311747461556015417 0ustar sugisugi#!ruby class ImageSize require "stringio" # Image Type Constants module Type OTHER = "OTHER" GIF = "GIF" PNG = "PNG" JPEG = "JPEG" BMP = "BMP" PPM = "PPM" # PPM is like PBM, PGM, & XV PBM = "PBM" PGM = "PGM" # XV = "XV" XBM = "XBM" TIFF = "TIFF" XPM = "XPM" PSD = "PSD" PCX = "PCX" SWF = "SWF" end JpegCodeCheck = [ "\xc0", "\xc1", "\xc2", "\xc3", "\xc5", "\xc6", "\xc7", "\xc9", "\xca", "\xcb", "\xcd", "\xce", "\xcf", ] # image type list def ImageSize.type_list Type.constants end # receive image & make size # argument 1 is image String, StringIO or IO # argument 2 is type(ImageSize::Type::GIF and so on.) or nil def initialize(img_data, img_type = nil) @img_data = img_data.dup @img_width = nil @img_height = nil @img_type = nil if @img_data.is_a?(IO) img_top = @img_data.read(1024) img_io = def_read_o(@img_data) elsif @img_data.is_a?(StringIO) img_top = @img_data.read(1024) img_io = def_read_o(@img_data) elsif @img_data.is_a?(String) img_top = @img_data[0, 1024] # img_io = StringIO.open(@img_data){|sio| io = def_read_o(sio); io } img_io = StringIO.open(@img_data) img_io = def_read_o(img_io) else raise "argument class error!! #{img_data.type}" end if @img_type.nil? @img_type = check_type(img_top) else type = Type.constants.find{|t| img_type == t } raise("type is failed. #{img_type}\n") if !type @img_type = img_type end if @img_type != Type::OTHER @img_width, @img_height = self.__send__("measure_#{@img_type}", img_io) else @img_width, @img_height = [nil, nil] end if @img_data.is_a?(String) img_io.close end end # get image type # ex. "GIF", "PNG", "JPEG" def get_type; @img_type; end # get image height def get_height if @img_type == Type::OTHER then nil else @img_height end end # get image width def get_width if @img_type == Type::OTHER then nil else @img_width end end # get image width and height(Array) def get_size [self.get_width, self.get_height] end alias :height :get_height alias :h :get_height alias :width :get_width alias :w :get_width alias :size :get_size private # define read_o def def_read_o(io) io.seek(0, 0) # define Singleton-method definition to IO (byte, offset) def io.read_o(length = 1, offset = nil) self.seek(offset, 0) if offset ret = self.read(length) raise "cannot read!!" unless ret ret end io end def check_type(img_top) if img_top =~ /^GIF8[7,9]a/ then Type::GIF elsif img_top[0, 8] == "\x89PNG\x0d\x0a\x1a\x0a" then Type::PNG elsif img_top[0, 2] == "\xFF\xD8" then Type::JPEG elsif img_top[0, 2] == 'BM' then Type::BMP elsif img_top =~ /^P[1-7]/ then Type::PPM elsif img_top =~ /\#define\s+\S+\s+\d+/ then Type::XBM elsif img_top[0, 4] == "MM\x00\x2a" then Type::TIFF elsif img_top[0, 4] == "II\x2a\x00" then Type::TIFF elsif img_top =~ /\/\* XPM \*\// then Type::XPM elsif img_top[0, 4] == "8BPS" then Type::PSD elsif img_top[1, 2] == "WS" then Type::SWF elsif img_top[0] == 10 then Type::PCX else Type::OTHER end end def measure_GIF(img_io) img_io.read_o(6) img_io.read_o(4).unpack('vv') end def measure_PNG(img_io) img_io.read_o(12) raise "This file is not PNG." unless img_io.read_o(4) == "IHDR" img_io.read_o(8).unpack('NN') end def measure_JPEG(img_io) c_marker = "\xFF" # Section marker. img_io.read_o(2) while(true) marker, code, length = img_io.read_o(4).unpack('aan') raise "JPEG marker not found!" if marker != c_marker if JpegCodeCheck.include?(code) height, width = img_io.read_o(5).unpack('xnn') return([width, height]) end img_io.read_o(length - 2) end end def measure_BMP(img_io) img_io.read_o(26).unpack("x18VV"); end def measure_PPM(img_io) header = img_io.read_o(1024) header.gsub!(/^\#[^\n\r]*/m, "") header =~ /^(P[1-6])\s+?(\d+)\s+?(\d+)/m width = $2.to_i; height = $3.to_i case $1 when "P1", "P4" then @img_type = "PBM" when "P2", "P5" then @img_type = "PGM" when "P3", "P6" then @img_type = "PPM" # when "P7" # @img_type = "XV" # header =~ /IMGINFO:(\d+)x(\d+)/m # width = $1.to_i; height = $2.to_i end [width, height] end alias :measure_PGM :measure_PPM alias :measure_PBM :measure_PPM def measure_XBM(img_io) img_io.read_o(1024) =~ /^\#define\s*\S*\s*(\d+)\s*\n\#define\s*\S*\s*(\d+)/mi [$1.to_i, $2.to_i] end def measure_XPM(img_io) width = height = nil while(line = img_io.read_o(1024)) if line =~ /"\s*(\d+)\s+(\d+)(\s+\d+\s+\d+){1,2}\s*"/m width = $1.to_i; height = $2.to_i break end end [width, height] end def measure_PSD(img_io) img_io.read_o(26).unpack("x14NN") end def measure_TIFF(img_io) endian = if (img_io.read_o(4) =~ /II\x2a\x00/o) then 'v' else 'n' end # 'v' little-endian 'n' default to big-endian packspec = [ nil, # nothing (shouldn't happen) 'C', # BYTE (8-bit unsigned integer) nil, # ASCII endian, # SHORT (16-bit unsigned integer) endian.upcase, # LONG (32-bit unsigned integer) nil, # RATIONAL 'c', # SBYTE (8-bit signed integer) nil, # UNDEFINED endian, # SSHORT (16-bit unsigned integer) endian.upcase, # SLONG (32-bit unsigned integer) ] offset = img_io.read_o(4).unpack(endian.upcase)[0] # Get offset to IFD ifd = img_io.read_o(2, offset) num_dirent = ifd.unpack(endian)[0] # Make it useful offset += 2 num_dirent = offset + (num_dirent * 12); # Calc. maximum offset of IFD ifd = width = height = nil while(width.nil? || height.nil?) ifd = img_io.read_o(12, offset) # Get first directory entry break if (ifd.nil? || (offset > num_dirent)) offset += 12 tag = ifd.unpack(endian)[0] # ...and decode its tag type = ifd[2, 2].unpack(endian)[0] # ...and the data type # Check the type for sanity. next if (type > packspec.size + 0) || (packspec[type].nil?) if tag == 0x0100 # Decode the value width = ifd[8, 4].unpack(packspec[type])[0] elsif tag == 0x0101 # Decode the value height = ifd[8, 4].unpack(packspec[type])[0] end end raise "#{if width.nil? then 'width not defined.' end} #{if height.nil? then 'height not defined.' end}" if width.nil? || height.nil? [width, height] end def measure_PCX(img_io) header = img_io.read_o(128) head_part = header.unpack('C4S4') width = head_part[6] - head_part[4] + 1 height = head_part[7] - head_part[5] + 1 [width, height] end def measure_SWF(img_io) header = img_io.read_o(9) sig1 = header[0,1] sig2 = header[1,1] sig3 = header[2,1] if !((sig1 == 'F' || sig1 == 'C') && sig2 == 'W' && sig3 == 'S') raise("This file is not SWF.") end bit_length = Integer("0b#{header.unpack('@8B5')}") header << img_io.read_o(bit_length*4/8+1) str = header.unpack("@8B#{5+bit_length*4}")[0] last = 5 x_min = Integer("0b#{str[last,bit_length]}") x_max = Integer("0b#{str[(last += bit_length),bit_length]}") y_min = Integer("0b#{str[(last += bit_length),bit_length]}") y_max = Integer("0b#{str[(last += bit_length),bit_length]}") width = (x_max - x_min)/20 height = (y_max - y_min)/20 [width, height] end end if __FILE__ == $0 print "TypeList: #{ImageSize.type.inspect}\n" Dir.glob("*").each do |file| print "#{file} (string)\n" open(file, "rb") do |fh| img = ImageSize.new(fh.read) print <<-EOF type: #{img.get_type.inspect} width: #{img.get_width.inspect} height: #{img.get_height.inspect} EOF end end end imagesize-0.1.1/README.txt0000644000175000017500000000213411747461556013704 0ustar sugisugi= image_size -- measure image size(GIF, PNG, JPEG ,,, etc) measure image (GIF, PNG, JPEG ,,, etc) size code by Pure Ruby ["PCX", "PSD", "XPM", "TIFF", "XBM", "PGM", "PBM", "PPM", "BMP", "JPEG", "PNG", "GIF", "SWF"] == Download The latest version of image_size can be found at * http://rubyforge.org/frs/?group_id=3460 == Installation === Normal Installation You can install image_size with the following command. % ruby setup.rb from its distribution directory. === GEM Installation Download and install image_size with the following. gem install imagesize == image_size References * image_size Project Page: http://rubyforge.org/projects/imagesize * image_size API Documents: http://imagesize.rubyforge.org == Simple Example ruby "rubygems" # you use rubygems 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).get_size end == Licence This code is free to use under the terms of the Ruby's licence. == Contact Comments are welcome. Send an email to "Keisuke Minami":mailto:keisuke@rccn.com imagesize-0.1.1/Manifest.txt0000644000175000017500000000046211747461556014517 0ustar sugisugiManifest.txt README.txt lib/image_size.rb lib/image_size/version.rb setup.rb test/test_helper.rb test/test_image_size.rb test/2-4-7.png test/4_1_2.gif test/bmp.bmp test/cursor.xbm test/detect.swf test/pbm.pbm test/pcx.pcx test/pgm.pgm test/test.xpm test/tiff.tiff test/tokyo_tower.jpg test/tower_e.gif.psd