image_science 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +1 -3
- data/History.txt +8 -1
- data/lib/image_science.rb +2 -2
- data/test/test_image_science.rb +22 -5
- metadata +11 -11
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
@@ -1,3 +1 @@
|
|
1
|
-
�
|
2
|
-
��Sf;��#���~|�'�s��
|
3
|
-
�
|
1
|
+
,��>~�K��qں���6/xǦ�{Ob����~�����h�:&~�x��`+t�$.����h*�%�����!U��|��`/�SKA�[��*��F�t�H&��1�c���̤��`6d�=q����� Z%`0�=�l�-��]gQ܄�U)��`��� ����1x8���#�S�=<��c�2��sx��� ��20��J;H�)�XN�?|�X��j�ӿJqXX��y�5�:�3�r]���)]�2�gCH8��$0��
|
data/History.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
=== 1.2.3 / 2012-05-07
|
2
|
+
|
3
|
+
* 2 bug fixes:
|
4
|
+
|
5
|
+
* Fixed thumbnail float imprecision errors. (jdelStrother)
|
6
|
+
* Switched to using tmpdir for INLINEDIR to avoid failures in CI environments w/o homedirs
|
7
|
+
|
1
8
|
=== 1.2.2 / 2012-03-13
|
2
9
|
|
3
10
|
* 1 minor enhancement:
|
@@ -20,7 +27,7 @@
|
|
20
27
|
|
21
28
|
* 7 minor enhancements:
|
22
29
|
|
23
|
-
*
|
30
|
+
* Moved quick_thumb to bin/image_science_thumb and properly added.
|
24
31
|
* Added -s (square) flag to bin/image_science_thumb
|
25
32
|
* Added autorotating on image load. (choonkeat)
|
26
33
|
* Added ruby_inline to clean globs
|
data/lib/image_science.rb
CHANGED
@@ -11,7 +11,7 @@ require 'inline'
|
|
11
11
|
# http://seattlerb.rubyforge.org/ImageScience.html
|
12
12
|
|
13
13
|
class ImageScience
|
14
|
-
VERSION = '1.2.
|
14
|
+
VERSION = '1.2.3'
|
15
15
|
|
16
16
|
##
|
17
17
|
# The top-level image loader opens +path+ and then yields the image.
|
@@ -60,7 +60,7 @@ class ImageScience
|
|
60
60
|
w, h = width, height
|
61
61
|
scale = size.to_f / (w > h ? w : h)
|
62
62
|
|
63
|
-
self.resize((w * scale).
|
63
|
+
self.resize((w * scale).round, (h * scale).round) do |image|
|
64
64
|
yield image
|
65
65
|
end
|
66
66
|
end
|
data/test/test_image_science.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'tmpdir'
|
2
|
+
dir = Dir.mktmpdir "image_science."
|
3
|
+
ENV['INLINEDIR'] = dir
|
4
|
+
MiniTest::Unit.after_tests do
|
3
5
|
require 'fileutils'
|
4
|
-
|
5
|
-
# force removal, Windoze is bitching at me, something to hunt later...
|
6
|
-
FileUtils.rm_r dir, :force => true
|
6
|
+
FileUtils.rm_rf dir
|
7
7
|
end
|
8
8
|
|
9
9
|
require 'rubygems'
|
@@ -157,4 +157,21 @@ class TestImageScience < MiniTest::Unit::TestCase
|
|
157
157
|
|
158
158
|
refute File.exists?(@tmppath)
|
159
159
|
end
|
160
|
+
|
161
|
+
def test_thumbnail
|
162
|
+
ImageScience.with_image @path do |img|
|
163
|
+
img.thumbnail(29) do |thumb|
|
164
|
+
assert thumb.save(@tmppath)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
assert File.exists?(@tmppath)
|
169
|
+
|
170
|
+
ImageScience.with_image @tmppath do |img|
|
171
|
+
assert_kind_of ImageScience, img
|
172
|
+
assert_equal 29, img.height
|
173
|
+
assert_equal 29, img.width
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
160
177
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image_science
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 3
|
10
|
+
version: 1.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FBHgymkyj/AOSqKRIpXPhjC6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2012-
|
39
|
+
date: 2012-05-07 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: RubyInline
|
@@ -61,11 +61,11 @@ dependencies:
|
|
61
61
|
requirements:
|
62
62
|
- - ~>
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
hash:
|
64
|
+
hash: 27
|
65
65
|
segments:
|
66
66
|
- 2
|
67
|
-
-
|
68
|
-
version: "2.
|
67
|
+
- 12
|
68
|
+
version: "2.12"
|
69
69
|
type: :development
|
70
70
|
version_requirements: *id002
|
71
71
|
- !ruby/object:Gem::Dependency
|
@@ -91,11 +91,11 @@ dependencies:
|
|
91
91
|
requirements:
|
92
92
|
- - ~>
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
hash:
|
94
|
+
hash: 7
|
95
95
|
segments:
|
96
|
-
-
|
97
|
-
-
|
98
|
-
version: "
|
96
|
+
- 3
|
97
|
+
- 0
|
98
|
+
version: "3.0"
|
99
99
|
type: :development
|
100
100
|
version_requirements: *id004
|
101
101
|
description: |-
|
metadata.gz.sig
CHANGED
Binary file
|