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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmNlNjk3NjQ1N2ZjYzFiOTc5MjU5N2ZhY2JlNjI4M2ZlNTUwNTA0Mg==
4
+ MTU4YzA0NzUyYWUyZWYzMDgzY2JhYTk1NmMyZGM0NzY4YTcyZjZkYw==
5
5
  data.tar.gz: !binary |-
6
- ODQ2MTBiYTg4ZjA1ZTZjZDVjM2ZiNzc1NWQ5ODYxZTgyNmUwNjM4OQ==
6
+ NmY0ZmEzNjg1MjdmNTg1ZGZjNTYwOTExNzAzMTJhNzNiNDdlZWU4NA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZDA3NTQ4YzdkMTRjZmRiNGIxZTdkN2QxNTI5N2I3YzBkZWI5NjU3ODQ3ZmQz
10
- Y2M4NDkxMTgxODQ1MGI4MzhlZWI0NjE0MmY2NTQyN2ZkNjgzMzUxNTIwYTYw
11
- YWU1MThhYWYzZmUzMTMxZGMxOTFmY2FmMTQzNmQ0YTI3MzRmZjU=
9
+ NjM1NjgxYzhiMTYwMTk4YWQ2NzUwZjVkZTE3NDFkN2I4NzZiM2RiYWQ3MjBi
10
+ OTExZjM1MTI0YmJiMzU3YTNkNWVhZmQ0M2ExMDE1ZGM4M2JkMTRkZTc3YTkw
11
+ ZWNmMWYxMWM4YWFjMGM4YTY0NjMyYTAwYTliMTc5ODIwMzZiOGU=
12
12
  data.tar.gz: !binary |-
13
- MGViZWJmNTY3ZTA1ZWJkNjcyMjE5YjQ0ZTViMTkxNzA4NmY3ZmU2MjkyNzJj
14
- MjM0YzUyNjkyODRhZWY1YmY1MTBjOWVmZWZmNDgzMGZlMjg4OTg0ZDY0NTUx
15
- ZDM3MzZkMWFjMTE1N2YwMGFjMWNmNDY0ZGRjYWJiMDg2NDFkZTY=
13
+ ZDE5NjZlNDc4OWYwOTYyYzM0YjQ4NTlhYzZjYzBkZmI5MjVjODZmYmUxZGU2
14
+ M2ZkNzk3YzI2Mjc4YzYwYmU1ODg5ZjIzYTAyZmYyNzk0YzFhMGRiYzlmYjZm
15
+ OGZiNDk4MDI4MGRkMzk3ZmEyZGU1NzY0ZWVlZjRkYzU4YTU2OTQ=
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'image_size'
5
- s.version = '1.3.0'
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}"
@@ -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
@@ -9,6 +9,7 @@ describe ImageSize do
9
9
  ['test3t.bmp',:bmp, 42, 50],
10
10
  ['test.gif', :gif, 668, 481],
11
11
  ['test.jpg', :jpeg, 320, 240],
12
+ ['test2.jpg',:jpeg, 320, 240],
12
13
  ['test.pbm', :pbm, 85, 55],
13
14
  ['test.pcx', :pcx, 70, 60],
14
15
  ['test.pgm', :pgm, 90, 55],
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.0
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-04-06 00:00:00.000000000 Z
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