fastimage 2.1.3 → 2.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/fastimage.rb +18 -2
  3. metadata +15 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e956eb7172b275c005a02bed97037ab008774579
4
- data.tar.gz: cccc887b76405eed9d65e239cad4325eaf4dc437
2
+ SHA256:
3
+ metadata.gz: 902efb5765c025c827bb5f757f9516a5c2fb023c0d6113d98107a8f83435f9f6
4
+ data.tar.gz: 2394630697a1bfc4cddfa102eecab62bb46df3feca9b0a9996ca52ec365045b9
5
5
  SHA512:
6
- metadata.gz: bf104614fb388b78077820a31b50c713a9a1c6579489758e7331f0247354e9347e27db7f672af36982d0faba4c4e4f44731583f4ae4d6d1eae8ec55657c6feaf
7
- data.tar.gz: 0d14f8f2ae9c597034ecc146f01884e33c3101ff2575679ac101bb3964c8af29f700dec14c4988955bde3600e6afb661a2ac8b62a633905cbb13175c19697035
6
+ metadata.gz: de2b26a82e0ddd6587dcbbbcda836d2edcef668939f9bf37df5910b5cf2dbcda9fb3668146d72d802cb45fde546cc16c44e62845c0e82194c3a6d83598d9ecbd
7
+ data.tar.gz: 720f45a86ef6c3261f2d66606c1fff42157738e4b4353f549eb576212d54ec8f6f934c229f22b62d0757c2db6784b8b2dae13b33a4a80ce60b15ea092d259b69
@@ -242,6 +242,17 @@ class FastImage
242
242
  fetch_using_http_from_parsed_uri
243
243
  end
244
244
 
245
+ # Some invalid locations need escaping
246
+ def escaped_location(location)
247
+ begin
248
+ URI(location)
249
+ rescue URI::InvalidURIError
250
+ URI.escape(location)
251
+ else
252
+ location
253
+ end
254
+ end
255
+
245
256
  def fetch_using_http_from_parsed_uri
246
257
  http_header = {'Accept-Encoding' => 'identity'}.merge(@options[:http_header])
247
258
 
@@ -250,7 +261,7 @@ class FastImage
250
261
  if res.is_a?(Net::HTTPRedirection) && @redirect_count < 4
251
262
  @redirect_count += 1
252
263
  begin
253
- @parsed_uri = URI.join(@parsed_uri, URI.escape(res['Location']))
264
+ @parsed_uri = URI.join(@parsed_uri, escaped_location(res['Location']))
254
265
  rescue URI::InvalidURIError
255
266
  else
256
267
  fetch_using_http_from_parsed_uri
@@ -472,7 +483,12 @@ class FastImage
472
483
  when 0x89.chr + "P"
473
484
  :png
474
485
  when "II", "MM"
475
- :tiff
486
+ case @stream.peek(11)[8..10]
487
+ when "APC", "CR\002"
488
+ nil # do not recognise CRW or CR2 as tiff
489
+ else
490
+ :tiff
491
+ end
476
492
  when '8B'
477
493
  :psd
478
494
  when "\0\0"
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastimage
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Sykes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-01 00:00:00.000000000 Z
11
+ date: 2018-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: fakeweb
14
+ name: fakeweb-fi
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.5'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: test-unit
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: FastImage finds the size or type of an image given its uri by fetching
@@ -83,22 +83,22 @@ licenses:
83
83
  metadata: {}
84
84
  post_install_message:
85
85
  rdoc_options:
86
- - --charset=UTF-8
86
+ - "--charset=UTF-8"
87
87
  require_paths:
88
88
  - lib
89
89
  required_ruby_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - '>='
91
+ - - ">="
92
92
  - !ruby/object:Gem::Version
93
93
  version: 1.9.2
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
- rubygems_version: 2.0.14.1
101
+ rubygems_version: 2.7.6
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: FastImage - Image info fast