image_size 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
 - data/image_size.gemspec +1 -1
 - data/lib/image_size.rb +4 -1
 - data/spec/image_size_spec.rb +1 -0
 - data/spec/test2.jpg +0 -0
 - metadata +4 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                MTU4YzA0NzUyYWUyZWYzMDgzY2JhYTk1NmMyZGM0NzY4YTcyZjZkYw==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                NmY0ZmEzNjg1MjdmNTg1ZGZjNTYwOTExNzAzMTJhNzNiNDdlZWU4NA==
         
     | 
| 
       7 
7 
     | 
    
         
             
            !binary "U0hBNTEy":
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                NjM1NjgxYzhiMTYwMTk4YWQ2NzUwZjVkZTE3NDFkN2I4NzZiM2RiYWQ3MjBi
         
     | 
| 
      
 10 
     | 
    
         
            +
                OTExZjM1MTI0YmJiMzU3YTNkNWVhZmQ0M2ExMDE1ZGM4M2JkMTRkZTc3YTkw
         
     | 
| 
      
 11 
     | 
    
         
            +
                ZWNmMWYxMWM4YWFjMGM4YTY0NjMyYTAwYTliMTc5ODIwMzZiOGU=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                ZDE5NjZlNDc4OWYwOTYyYzM0YjQ4NTlhYzZjYzBkZmI5MjVjODZmYmUxZGU2
         
     | 
| 
      
 14 
     | 
    
         
            +
                M2ZkNzk3YzI2Mjc4YzYwYmU1ODg5ZjIzYTAyZmYyNzk0YzFhMGRiYzlmYjZm
         
     | 
| 
      
 15 
     | 
    
         
            +
                OGZiNDk4MDI4MGRkMzk3ZmEyZGU1NzY0ZWVlZjRkYzU4YTU2OTQ=
         
     | 
    
        data/image_size.gemspec
    CHANGED
    
    | 
         @@ -2,7 +2,7 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       4 
4 
     | 
    
         
             
              s.name        = 'image_size'
         
     | 
| 
       5 
     | 
    
         
            -
              s.version     = '1.3. 
     | 
| 
      
 5 
     | 
    
         
            +
              s.version     = '1.3.1'
         
     | 
| 
       6 
6 
     | 
    
         
             
              s.summary     = %q{Measure image size using pure Ruby}
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.description = %q{Measure following file dimensions: bmp, gif, jpeg, pbm, pcx, pgm, png, ppm, psd, swf, tiff, xbm, xpm}
         
     | 
| 
       8 
8 
     | 
    
         
             
              s.homepage    = "http://github.com/toy/#{s.name}"
         
     | 
    
        data/lib/image_size.rb
    CHANGED
    
    | 
         @@ -135,9 +135,12 @@ private 
     | 
|
| 
       135 
135 
     | 
    
         
             
                section_marker = "\xFF"
         
     | 
| 
       136 
136 
     | 
    
         
             
                offset = 2
         
     | 
| 
       137 
137 
     | 
    
         
             
                loop do
         
     | 
| 
      
 138 
     | 
    
         
            +
                  offset += 1 until [nil, section_marker].include? ir[offset, 1]
         
     | 
| 
      
 139 
     | 
    
         
            +
                  offset += 1 until section_marker != ir[offset + 1, 1]
         
     | 
| 
      
 140 
     | 
    
         
            +
                  raise FormatError, 'EOF in JPEG' if ir[offset, 1].nil?
         
     | 
| 
      
 141 
     | 
    
         
            +
             
     | 
| 
       138 
142 
     | 
    
         
             
                  marker, code, length = ir[offset, 4].unpack('aan')
         
     | 
| 
       139 
143 
     | 
    
         
             
                  offset += 4
         
     | 
| 
       140 
     | 
    
         
            -
                  raise FormatError, 'JPEG marker not found' if marker != section_marker
         
     | 
| 
       141 
144 
     | 
    
         | 
| 
       142 
145 
     | 
    
         
             
                  if JpegCodeCheck.include?(code)
         
     | 
| 
       143 
146 
     | 
    
         
             
                    return ir[offset + 1, 4].unpack('nn').reverse
         
     | 
    
        data/spec/image_size_spec.rb
    CHANGED
    
    
    
        data/spec/test2.jpg
    ADDED
    
    | 
         Binary file 
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: image_size
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.3.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Keisuke Minami
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2014- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2014-06-24 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: rspec
         
     | 
| 
         @@ -52,6 +52,7 @@ files: 
     | 
|
| 
       52 
52 
     | 
    
         
             
            - spec/test.xbm
         
     | 
| 
       53 
53 
     | 
    
         
             
            - spec/test.xpm
         
     | 
| 
       54 
54 
     | 
    
         
             
            - spec/test2.bmp
         
     | 
| 
      
 55 
     | 
    
         
            +
            - spec/test2.jpg
         
     | 
| 
       55 
56 
     | 
    
         
             
            - spec/test3b.bmp
         
     | 
| 
       56 
57 
     | 
    
         
             
            - spec/test3t.bmp
         
     | 
| 
       57 
58 
     | 
    
         
             
            homepage: http://github.com/toy/image_size
         
     | 
| 
         @@ -93,5 +94,6 @@ test_files: 
     | 
|
| 
       93 
94 
     | 
    
         
             
            - spec/test.xbm
         
     | 
| 
       94 
95 
     | 
    
         
             
            - spec/test.xpm
         
     | 
| 
       95 
96 
     | 
    
         
             
            - spec/test2.bmp
         
     | 
| 
      
 97 
     | 
    
         
            +
            - spec/test2.jpg
         
     | 
| 
       96 
98 
     | 
    
         
             
            - spec/test3b.bmp
         
     | 
| 
       97 
99 
     | 
    
         
             
            - spec/test3t.bmp
         
     |