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 +4 -4
- data/README.textile +2 -0
- data/lib/fastimage.rb +7 -1
- data/test/test.rb +8 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14c971688e6b8e577baf835c98f64700081af0bd
|
4
|
+
data.tar.gz: 25ffa6572caf216c99a7dcfbdc2a1d6cc5a40b2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ae55b045d02d4c1a7ce3452ed3da248e01312a9059bbef29c6e57a780a53ba0874c1566b9703b0ddb143e12d7827609194fa52b151cbe5a30861c2e6644c685
|
7
|
+
data.tar.gz: 15c0ee070dc9f516592445a29ae66c2c38f5b93a1572c5befa68a3d9227806a7345840ed8a88c1352b8a307ed0fa7b6224efa0d19d219f92d708863347fffda8
|
data/README.textile
CHANGED
@@ -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
|
|
data/lib/fastimage.rb
CHANGED
@@ -436,8 +436,14 @@ class FastImage
|
|
436
436
|
else
|
437
437
|
raise UnknownImageType
|
438
438
|
end
|
439
|
-
when "
|
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
|
data/test/test.rb
CHANGED
@@ -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.
|
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
|
+
date: 2015-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|