fastimage 1.5.4 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastimage.rb +11 -2
  3. data/test/test.rb +1 -0
  4. metadata +31 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb9d75d5620c240241218d8a9dc5219882bdaf56
4
- data.tar.gz: 6df2e5e2117e2e7595dc2492e904e76109762c67
3
+ metadata.gz: c63f6d99fe0d72ebc82cc5e9f6af7de6d6fef324
4
+ data.tar.gz: 572d3036b3af69025a484a9b446c6d6821d5979e
5
5
  SHA512:
6
- metadata.gz: 91d8c6996afb13c592796d913ddf35f015e1191bdca7d1402b63df88f54ede5fd72b9409fe14fb44ce7911f0a075bb74a453a9a4d84c95bfe6b3249c28714f27
7
- data.tar.gz: ab50ea1309e9f60c1c8ca2d65e75634cd3b64a3f0ccffe637394513083d9faa51ca7e2145924ebe4defb4b06f0dcc4f306f69fde4db9612dad61a3f97c650d8d
6
+ metadata.gz: e81707dfb27fd2fe650f497fcf0f9143a37cd15ad824471c897819167fe2b7c0f0ac21cddef4caec899b096a7e052734d0e0eca4a03e49e44fa715092c6cee34
7
+ data.tar.gz: b7b3d2d371f15adc282d538ffa61ed199256fe45dcd90764fac603f0cbe3c3de45d69a066d7eff5608e62b8bd233e38fbefd5a96adbd63ec77429a3130bff042
@@ -413,8 +413,17 @@ class FastImage
413
413
  end
414
414
 
415
415
  def parse_size_for_bmp
416
- d = get_chars(29)[14..28]
417
- d.unpack("C")[0] == 40 ? d[4..-1].unpack('LL') : d[4..8].unpack('SS')
416
+ d = get_chars(32)[14..28]
417
+ header = d.unpack("C")[0]
418
+
419
+ result = if header == 40
420
+ d[4..-1].unpack('l<l<')
421
+ else
422
+ d[4..8].unpack('SS')
423
+ end
424
+
425
+ # ImageHeight is expressed in pixels. The absolute value is necessary because ImageHeight can be negative
426
+ [result.first, result.last.abs]
418
427
  end
419
428
 
420
429
  def get_exif_byte_order
@@ -12,6 +12,7 @@ FixturePath = File.join(PathHere, "fixtures")
12
12
 
13
13
  GoodFixtures = {
14
14
  "test.bmp"=>[:bmp, [40, 27]],
15
+ "test2.bmp"=>[:bmp, [1920, 1080]],
15
16
  "test.gif"=>[:gif, [17, 32]],
16
17
  "test.jpg"=>[:jpeg, [882, 470]],
17
18
  "test.png"=>[:png, [30, 20]],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastimage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Sykes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-14 00:00:00.000000000 Z
11
+ date: 2013-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -44,6 +44,34 @@ dependencies:
44
44
  - - ~>
45
45
  - !ruby/object:Gem::Version
46
46
  version: '1.3'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rdoc
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
47
75
  description: FastImage finds the size or type of an image given its uri by fetching
48
76
  as little as needed.
49
77
  email: sdsykes@gmail.com
@@ -91,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
119
  version: '0'
92
120
  requirements: []
93
121
  rubyforge_project:
94
- rubygems_version: 2.0.0
122
+ rubygems_version: 2.0.3
95
123
  signing_key:
96
124
  specification_version: 4
97
125
  summary: FastImage - Image info fast