fastimage 2.1.1 → 2.1.2

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 +4 -4
  2. data/lib/fastimage.rb +4 -11
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 286c430f0c94ceafdbcbe884ae9bee4252e549c0
4
- data.tar.gz: c006bb076bdefba5bfdea4f024c8f327189b0b83
3
+ metadata.gz: 74fc8be5d9ead8961a52aa89c0df0ff8a007f0c7
4
+ data.tar.gz: caad48d5e5120cb0e4ee877b0511cb62e4ec3b95
5
5
  SHA512:
6
- metadata.gz: cb7f192a5d7c2909c9b5275305608ed3c2e9c97e6d7fc9d0bd1386b08e3ccc29621a8cff9ba3b83eae4651fdbf8c27b2aa0cd70c5dea50efcd0912c7d82fcdc2
7
- data.tar.gz: 72a91dbf2da909e0ebadbbd902fb7ffbbd3d7718073726fed3b23044bbc67134892008d227607d0f27e4b89ba464a451526a95c3bb047ed353c9addb98485a63
6
+ metadata.gz: 5e72700677ce5ae10030abb6a8083025437997f44cb1c854ec6d9ca951363e5dd324e0d7c80eae0b35fbafe55592d30e7fad78aae6acf7a90496f11b903ed5a8
7
+ data.tar.gz: 97fdb59e67a882064d5989e0d0c17ee87ef35b133c0fb93183e733c487fb766fc7cb9411421a5fc5165edb616516ff70b98ea627c7887b261b16384077c03bee
@@ -214,7 +214,7 @@ class FastImage
214
214
  raise SizeNotFound if @options[:raise_on_failure] && @property == :size && !@size
215
215
 
216
216
  rescue Timeout::Error, SocketError, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ECONNRESET,
217
- ImageFetchFailure, Net::HTTPBadResponse, EOFError, Errno::ENOENT
217
+ ImageFetchFailure, Net::HTTPBadResponse, EOFError, Errno::ENOENT, OpenSSL::SSL::SSLError
218
218
  raise ImageFetchFailure if @options[:raise_on_failure]
219
219
  rescue NoMethodError # 1.8.7p248 can raise this due to a net/http bug
220
220
  raise ImageFetchFailure if @options[:raise_on_failure]
@@ -250,15 +250,7 @@ class FastImage
250
250
  if res.is_a?(Net::HTTPRedirection) && @redirect_count < 4
251
251
  @redirect_count += 1
252
252
  begin
253
- newly_parsed_uri = URI.parse(res['Location'])
254
- # The new location may be relative - check for that
255
- if protocol_relative_url?(res['Location'])
256
- @parsed_uri = URI.parse("#{@parsed_uri.scheme}:#{res['Location']}")
257
- elsif newly_parsed_uri.scheme != "http" && newly_parsed_uri.scheme != "https"
258
- @parsed_uri.path = res['Location']
259
- else
260
- @parsed_uri = newly_parsed_uri
261
- end
253
+ @parsed_uri = URI.join(@parsed_uri, res['Location'])
262
254
  rescue URI::InvalidURIError
263
255
  else
264
256
  fetch_using_http_from_parsed_uri
@@ -539,7 +531,8 @@ class FastImage
539
531
  io = StringIO.new(data)
540
532
  if io.read(4) == "Exif"
541
533
  io.read(2)
542
- exif = Exif.new(IOStream.new(io)) rescue nil
534
+ new_exif = Exif.new(IOStream.new(io)) rescue nil
535
+ exif ||= new_exif # only use the first APP1 segment
543
536
  end
544
537
  :started
545
538
  when 0xe0..0xef
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: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Sykes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-18 00:00:00.000000000 Z
11
+ date: 2018-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fakeweb