sobakasu-image_science 1.1.4 → 1.1.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/ext/extconf.rb +1 -1
- data/ext/image_science_ext.c.in +7 -7
- data/lib/image_science.rb +1 -1
- metadata +6 -26
data/ext/extconf.rb
CHANGED
@@ -29,7 +29,7 @@ def expand_constants
|
|
29
29
|
constants[$1] << [name]
|
30
30
|
end
|
31
31
|
|
32
|
-
raw_headers = headers.collect { |i| File.read(i) }.join
|
32
|
+
raw_headers = headers.collect { |i| File.read(i, :encoding => "ISO-8859-1") }.join
|
33
33
|
|
34
34
|
# add #defined constants (load/save flags)
|
35
35
|
constants['FLAG'] ||= []
|
data/ext/image_science_ext.c.in
CHANGED
@@ -110,7 +110,7 @@ static VALUE isc_init2(VALUE self, VALUE image, VALUE flags_arg, int is_file)
|
|
110
110
|
flags_given = !NIL_P(flags_arg);
|
111
111
|
|
112
112
|
Check_Type(image, T_STRING);
|
113
|
-
img =
|
113
|
+
img = RSTRING_PTR(image);
|
114
114
|
|
115
115
|
if (is_file) {
|
116
116
|
/* argument is a file */
|
@@ -127,7 +127,7 @@ static VALUE isc_init2(VALUE self, VALUE image, VALUE flags_arg, int is_file)
|
|
127
127
|
}
|
128
128
|
else {
|
129
129
|
/* attempt to read argument as image data */
|
130
|
-
image_data_length =
|
130
|
+
image_data_length = RSTRING_LEN(image);
|
131
131
|
stream = FreeImage_OpenMemory((BYTE *)img, image_data_length);
|
132
132
|
|
133
133
|
fif = FreeImage_GetFileTypeFromMemory(stream, 0);
|
@@ -212,7 +212,7 @@ static VALUE get_version(VALUE self) {
|
|
212
212
|
* currently not used and can be set to 0.
|
213
213
|
*/
|
214
214
|
static VALUE file_type(VALUE self, VALUE filename) {
|
215
|
-
char * input =
|
215
|
+
char * input = RSTRING_PTR(filename);
|
216
216
|
FREE_IMAGE_FORMAT fif = FIF_UNKNOWN;
|
217
217
|
|
218
218
|
fif = FreeImage_GetFileType(input, 0);
|
@@ -255,7 +255,7 @@ static VALUE buffer(int argc, VALUE *argv, VALUE self) {
|
|
255
255
|
|
256
256
|
if ((fif == FIF_UNKNOWN) || !FreeImage_FIFSupportsWriting(fif)) {
|
257
257
|
snprintf(message, 1023, "Unknown file format: %d", fif);
|
258
|
-
rb_raise(rb_eTypeError, message);
|
258
|
+
rb_raise(rb_eTypeError, "%s", message);
|
259
259
|
}
|
260
260
|
|
261
261
|
GET_BITMAP(bitmap);
|
@@ -417,7 +417,7 @@ static VALUE set_pixel_color(int argc, VALUE *argv, VALUE self) {
|
|
417
417
|
value1 = rb_ary_entry(set_value, 0);
|
418
418
|
if(TYPE(value1) == T_ARRAY) set_value = value1;
|
419
419
|
|
420
|
-
value_length =
|
420
|
+
value_length = RARRAY_LEN(set_value);
|
421
421
|
}
|
422
422
|
|
423
423
|
if(value_length < 3 || value_length > 4) {
|
@@ -484,7 +484,7 @@ static VALUE resize(int argc, VALUE *argv, VALUE self) {
|
|
484
484
|
*/
|
485
485
|
static VALUE save(VALUE self, VALUE filename) {
|
486
486
|
int flags;
|
487
|
-
char * output =
|
487
|
+
char * output = RSTRING_PTR(filename);
|
488
488
|
FIBITMAP *bitmap, *new_bitmap;
|
489
489
|
FREE_IMAGE_FORMAT fif = FreeImage_GetFIFFromFilename(output);
|
490
490
|
if (fif == FIF_UNKNOWN) fif = FIX2INT(rb_iv_get(self, "@file_type"));
|
@@ -739,7 +739,7 @@ static VALUE isc_init(int argc, VALUE *argv, VALUE self)
|
|
739
739
|
|
740
740
|
rb_scan_args(argc, argv, "11", &image, &flags_arg);
|
741
741
|
Check_Type(image, T_STRING);
|
742
|
-
img =
|
742
|
+
img = RSTRING_PTR(image);
|
743
743
|
is_file = !stat(img, &buf);
|
744
744
|
|
745
745
|
return isc_init2(self, image, flags_arg, is_file);
|
data/lib/image_science.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sobakasu-image_science
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 27
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 1
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
8
|
+
- 5
|
9
|
+
version: 1.1.5
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Ryan Davis
|
@@ -16,41 +15,24 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date: 2010-
|
18
|
+
date: 2010-12-16 00:00:00 +10:30
|
20
19
|
default_executable:
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
23
|
-
name:
|
22
|
+
name: hoe
|
24
23
|
prerelease: false
|
25
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
25
|
none: false
|
27
26
|
requirements:
|
28
27
|
- - ">="
|
29
28
|
- !ruby/object:Gem::Version
|
30
|
-
hash: 7
|
31
29
|
segments:
|
32
30
|
- 2
|
31
|
+
- 8
|
33
32
|
- 0
|
34
|
-
|
35
|
-
version: 2.0.4
|
33
|
+
version: 2.8.0
|
36
34
|
type: :development
|
37
35
|
version_requirements: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: hoe
|
40
|
-
prerelease: false
|
41
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
|
-
requirements:
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
hash: 19
|
47
|
-
segments:
|
48
|
-
- 2
|
49
|
-
- 6
|
50
|
-
- 2
|
51
|
-
version: 2.6.2
|
52
|
-
type: :development
|
53
|
-
version_requirements: *id002
|
54
36
|
description: |-
|
55
37
|
ImageScience is a clean and happy Ruby library that generates
|
56
38
|
thumbnails -- and kicks the living crap out of RMagick. Oh, and it
|
@@ -106,7 +88,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
88
|
requirements:
|
107
89
|
- - ">="
|
108
90
|
- !ruby/object:Gem::Version
|
109
|
-
hash: 3
|
110
91
|
segments:
|
111
92
|
- 0
|
112
93
|
version: "0"
|
@@ -115,7 +96,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
96
|
requirements:
|
116
97
|
- - ">="
|
117
98
|
- !ruby/object:Gem::Version
|
118
|
-
hash: 3
|
119
99
|
segments:
|
120
100
|
- 0
|
121
101
|
version: "0"
|