image_science 1.2.4 → 1.2.5
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.
- data.tar.gz.sig +0 -0
- data/History.txt +12 -6
- data/README.txt +1 -1
- data/lib/image_science.rb +20 -17
- data/test/test_image_science.rb +2 -2
- metadata +16 -16
- metadata.gz.sig +1 -2
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 1.2.5 / 2013-06-20
|
2
|
+
|
3
|
+
* 1 bug fix:
|
4
|
+
|
5
|
+
* Fixed memory leak in the ReOrient function. (Blargel/abnerqian)
|
6
|
+
|
1
7
|
=== 1.2.4 / 2012-11-23
|
2
8
|
|
3
9
|
* 1 minor enhancement:
|
@@ -29,7 +35,7 @@
|
|
29
35
|
* Added luis' patches to make it build properly on windows.
|
30
36
|
* with_image now raises on missing/bad files.
|
31
37
|
|
32
|
-
|
38
|
+
=== 1.2.0 / 2009-06-23
|
33
39
|
|
34
40
|
* 7 minor enhancements:
|
35
41
|
|
@@ -47,21 +53,21 @@
|
|
47
53
|
* Fixed 1.9isms
|
48
54
|
* Fixed BMP support. Tweaked whitespace.
|
49
55
|
|
50
|
-
|
56
|
+
=== 1.1.3 / 2007-05-30
|
51
57
|
|
52
58
|
* 2 minor enhancements:
|
53
59
|
|
54
60
|
* Added quick_thumb as an example to look at.
|
55
61
|
* Error handler doesn't raise by default. Raises if $DEBUG==true.
|
56
62
|
|
57
|
-
|
63
|
+
=== 1.1.2 / 2007-04-18
|
58
64
|
|
59
65
|
* 2 bug fixes:
|
60
66
|
|
61
67
|
* reports bad height/width values for resize
|
62
68
|
* explicitly removes ICC color profiles from PNGs (bug in freeimage).
|
63
69
|
|
64
|
-
|
70
|
+
=== 1.1.1 / 2007-03-08
|
65
71
|
|
66
72
|
* 5 minor enhancements:
|
67
73
|
|
@@ -76,7 +82,7 @@
|
|
76
82
|
|
77
83
|
* Fixed rdoc
|
78
84
|
|
79
|
-
|
85
|
+
=== 1.1.0 / 2007-01-05
|
80
86
|
|
81
87
|
* 3 major enhancements:
|
82
88
|
|
@@ -93,7 +99,7 @@
|
|
93
99
|
* Fixed the linker issue on PPC.
|
94
100
|
* Rakefile will now clean the image files created by bench.rb
|
95
101
|
|
96
|
-
|
102
|
+
=== 1.0.0 / 2006-12-01
|
97
103
|
|
98
104
|
* 1 major enhancement
|
99
105
|
|
data/README.txt
CHANGED
@@ -17,7 +17,7 @@ For more information including build steps, see http://seattlerb.rubyforge.org/
|
|
17
17
|
* Supports square and proportional thumbnails, as well as arbitrary resizes.
|
18
18
|
* Pretty much any graphics format you could want. No really.
|
19
19
|
|
20
|
-
==
|
20
|
+
== SYNOPSIS:
|
21
21
|
|
22
22
|
ImageScience.with_image file do |img|
|
23
23
|
img.cropped_thumbnail 100 do |thumb|
|
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.5'
|
15
15
|
|
16
16
|
##
|
17
17
|
# The top-level image loader opens +path+ and then yields the image.
|
@@ -151,22 +151,25 @@ class ImageScience
|
|
151
151
|
|
152
152
|
builder.prefix <<-"END"
|
153
153
|
FIBITMAP* ReOrient(FIBITMAP *bitmap) {
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
154
|
+
FITAG *tagValue = NULL;
|
155
|
+
FIBITMAP *oldBitmap = bitmap;
|
156
|
+
FreeImage_GetMetadata(FIMD_EXIF_MAIN, bitmap, "Orientation", &tagValue);
|
157
|
+
switch (tagValue == NULL ? 0 : *((short *) FreeImage_GetTagValue(tagValue))) {
|
158
|
+
case 6:
|
159
|
+
bitmap = FreeImage_RotateClassic(bitmap, 270);
|
160
|
+
break;
|
161
|
+
case 3:
|
162
|
+
bitmap = FreeImage_RotateClassic(bitmap, 180);
|
163
|
+
break;
|
164
|
+
case 8:
|
165
|
+
bitmap = FreeImage_RotateClassic(bitmap, 90);
|
166
|
+
break;
|
167
|
+
default:
|
168
|
+
bitmap = FreeImage_Clone(bitmap);
|
169
|
+
break;
|
170
|
+
}
|
171
|
+
FreeImage_Unload(oldBitmap);
|
172
|
+
return bitmap;
|
170
173
|
}
|
171
174
|
END
|
172
175
|
|
data/test/test_image_science.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'tmpdir'
|
2
2
|
dir = Dir.mktmpdir "image_science."
|
3
3
|
ENV['INLINEDIR'] = dir
|
4
|
-
|
4
|
+
Minitest.after_run do
|
5
5
|
require 'fileutils'
|
6
6
|
FileUtils.rm_rf dir
|
7
7
|
end
|
@@ -11,7 +11,7 @@ require 'minitest/unit'
|
|
11
11
|
require 'minitest/autorun' if $0 == __FILE__
|
12
12
|
require 'image_science'
|
13
13
|
|
14
|
-
class TestImageScience <
|
14
|
+
class TestImageScience < Minitest::Test
|
15
15
|
def setup
|
16
16
|
@path = 'test/pix.png'
|
17
17
|
@tmppath = 'test/pix-tmp.png'
|
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: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 5
|
10
|
+
version: 1.2.5
|
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:
|
39
|
+
date: 2013-06-21 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: 31
|
65
65
|
segments:
|
66
|
-
-
|
67
|
-
-
|
68
|
-
version: "
|
66
|
+
- 5
|
67
|
+
- 0
|
68
|
+
version: "5.0"
|
69
69
|
type: :development
|
70
70
|
version_requirements: *id002
|
71
71
|
- !ruby/object:Gem::Dependency
|
@@ -76,11 +76,11 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - ~>
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
hash:
|
79
|
+
hash: 27
|
80
80
|
segments:
|
81
|
-
-
|
82
|
-
-
|
83
|
-
version: "
|
81
|
+
- 4
|
82
|
+
- 0
|
83
|
+
version: "4.0"
|
84
84
|
type: :development
|
85
85
|
version_requirements: *id003
|
86
86
|
- !ruby/object:Gem::Dependency
|
@@ -91,11 +91,11 @@ dependencies:
|
|
91
91
|
requirements:
|
92
92
|
- - ~>
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
hash:
|
94
|
+
hash: 11
|
95
95
|
segments:
|
96
96
|
- 3
|
97
|
-
-
|
98
|
-
version: "3.
|
97
|
+
- 6
|
98
|
+
version: "3.6"
|
99
99
|
type: :development
|
100
100
|
version_requirements: *id004
|
101
101
|
description: |-
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
requirements: []
|
157
157
|
|
158
158
|
rubyforge_project: seattlerb
|
159
|
-
rubygems_version: 1.8.
|
159
|
+
rubygems_version: 1.8.25
|
160
160
|
signing_key:
|
161
161
|
specification_version: 3
|
162
162
|
summary: ImageScience is a clean and happy Ruby library that generates thumbnails -- and kicks the living crap out of RMagick
|
metadata.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
Tg��6���̞�x�B!]R�J���Z.T��,�L H΄:
|
1
|
+
2�4:��N�$�!��[�Y�d@���k�Cx��qW��ǀ��6�Xt��4��*���X�ŀ�|`��2�p�3��wK�
|