discourse_fastimage 2.0.2 → 2.0.3

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 +5 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32e2a6bf8727bcb2595ef2532ed4aff1b4c0aea4
4
- data.tar.gz: 130215f95f4bc5fa2f30a03adb6771c2d513d5ef
3
+ metadata.gz: 37620cc6b20562783bb7d7ac06cb535065a3e935
4
+ data.tar.gz: 07baa13fdec2f77276878545814d4ef32487bf41
5
5
  SHA512:
6
- metadata.gz: e1f6fe0cd2fdea8cf8c5d75a8684e29be93fa6eb5243ef613116d86ad4ba2831bf4062fa0bf6061de545fc313923476436ff83c53ad8a0a7cd12ac3548c2e35e
7
- data.tar.gz: 5601069e36378b0d6bb6b41194ff7273a81f9caa3abe009965ac68b6d2660f0cee98194344c12da6dad4de5af9da4a702c95110aae3a5843457e52fbd74b9739
6
+ metadata.gz: e4084b661aa9e3f56af4bac6bf48630b3eedcbdb42f7a28e0fb6f7b64aecd8e42036ec4aeef46c0482439a0ce8be41743977c1d16b782804f85c2327195b1522
7
+ data.tar.gz: bde96e05a4e9826421cc6335e4d08a6dd838eae1c2a0e34c9f1040296e562f40b0ccef6e94b49a04a005ee434ccf0a2e8a00bb1efad567d5291125f63f010e1e
data/lib/fastimage.rb CHANGED
@@ -477,13 +477,11 @@ class FastImage
477
477
  when "<s"
478
478
  :svg
479
479
  when "<?"
480
- first_100_characters = @stream.peek(100) rescue nil
481
- return :svg if first_100_characters && first_100_characters.include?("<svg")
482
-
483
- first_200_characters = @stream.peek(200) rescue nil
484
- return :svg if first_200_characters && first_200_characters.include?("<svg")
485
-
486
- raise UnknownImageType
480
+ (10..200).step(10).each do |length|
481
+ characters = @stream.peek(length) rescue nil
482
+ raise UnknownImageType if characters.nil?
483
+ return :svg if characters.include?("<svg")
484
+ end
487
485
  else
488
486
  raise UnknownImageType
489
487
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_fastimage
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Sykes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-06 00:00:00.000000000 Z
11
+ date: 2016-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fakeweb