fastimage 1.8.0 → 1.8.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7228e29b8a52ce589113f051bc142a9e55fefe86
4
- data.tar.gz: 6b50be8521f450dd9da08ab018e9a2467c66e62c
3
+ metadata.gz: 14c971688e6b8e577baf835c98f64700081af0bd
4
+ data.tar.gz: 25ffa6572caf216c99a7dcfbdc2a1d6cc5a40b2e
5
5
  SHA512:
6
- metadata.gz: 279f60c5b465c44af94619671f803bac088e7b457a41b4b4c203dcbfbf0c0a44a08fd70cafa0740686f00b1b3f01f4efe1f272faac9add9602234aba804be95a
7
- data.tar.gz: b8bc0f0ed9d6fb0944f5c28121a3f7d17a70f16eeee80bd4fb3a46525cd2153b59df5c959f8817a70cec395d50c5b61e599595d6f706fe9b56f094a139c88bff
6
+ metadata.gz: 7ae55b045d02d4c1a7ce3452ed3da248e01312a9059bbef29c6e57a780a53ba0874c1566b9703b0ddb143e12d7827609194fa52b151cbe5a30861c2e6644c685
7
+ data.tar.gz: 15c0ee070dc9f516592445a29ae66c2c38f5b93a1572c5befa68a3d9227806a7345840ed8a88c1352b8a307ed0fa7b6224efa0d19d219f92d708863347fffda8
@@ -137,6 +137,8 @@ h2. FastImage in other languages
137
137
  * "Swift by kaishin":https://github.com/kaishin/ImageScout
138
138
  * "Go by rubenfonseca":https://github.com/rubenfonseca/fastimage
139
139
  * "PHP by tommoor":https://github.com/tommoor/fastimage
140
+ * "Node.js by ShogunPanda":https://github.com/ShogunPanda/fastimage
141
+ * "Objective C by kylehickinson":https://github.com/kylehickinson/FastImage
140
142
 
141
143
  h2. Licence
142
144
 
@@ -436,8 +436,14 @@ class FastImage
436
436
  else
437
437
  raise UnknownImageType
438
438
  end
439
- when "<?", "<s"
439
+ when "<s"
440
440
  :svg
441
+ when "<?"
442
+ if @stream.peek(100).include?("<svg")
443
+ :svg
444
+ else
445
+ raise UnknownImageType
446
+ end
441
447
  else
442
448
  raise UnknownImageType
443
449
  end
@@ -37,7 +37,8 @@ GoodFixtures = {
37
37
 
38
38
  BadFixtures = [
39
39
  "faulty.jpg",
40
- "test_rgb.ct"
40
+ "test_rgb.ct",
41
+ "test.xml"
41
42
  ]
42
43
  # man.ico courtesy of http://www.iconseeker.com/search-icon/artists-valley-sample/business-man-blue.html
43
44
  # test_rgb.ct courtesy of http://fileformats.archiveteam.org/wiki/Scitex_CT
@@ -122,6 +123,12 @@ class FastImageTest < Test::Unit::TestCase
122
123
  end
123
124
  end
124
125
 
126
+ def test_should_raise_unknown_image_typ_when_file_is_non_svg_xml
127
+ assert_raises(FastImage::UnknownImageType) do
128
+ FastImage.size(TestUrl + "test.xml", :raise_on_failure=>true)
129
+ end
130
+ end
131
+
125
132
  def test_should_report_type_correctly_for_local_files
126
133
  GoodFixtures.each do |fn, info|
127
134
  assert_equal info[0], FastImage.type(File.join(FixturePath, fn))
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.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Sykes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-13 00:00:00.000000000 Z
11
+ date: 2015-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable