jpeg 0.2.2 → 0.3.0
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/LICENSE.txt +1 -1
- data/README.rdoc +3 -0
- data/VERSION +1 -1
- data/ext/jpeg_jpeg.c +10 -0
- data/jpeg.gemspec +2 -2
- data/lib/jpeg.rb +8 -0
- data/spec/jpeg_spec.rb +3 -0
- metadata +3 -3
data/LICENSE.txt
CHANGED
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/ext/jpeg_jpeg.c
CHANGED
@@ -12,6 +12,7 @@ static void jpeg_jpeg_free(struct jpeg_jpeg *p);
|
|
12
12
|
static VALUE jpeg_jpeg_width(VALUE self);
|
13
13
|
static VALUE jpeg_jpeg_height(VALUE self);
|
14
14
|
static VALUE jpeg_jpeg_size(VALUE self);
|
15
|
+
static VALUE jpeg_jpeg_color_info(VALUE self);
|
15
16
|
|
16
17
|
extern VALUE Jpeg_Error;
|
17
18
|
|
@@ -22,7 +23,9 @@ void Init_jpeg_jpeg() {
|
|
22
23
|
rb_define_method(Jpeg, "width", jpeg_jpeg_width, 0);
|
23
24
|
rb_define_method(Jpeg, "height", jpeg_jpeg_height, 0);
|
24
25
|
rb_define_method(Jpeg, "size", jpeg_jpeg_size, 0);
|
26
|
+
rb_define_method(Jpeg, "color_info", jpeg_jpeg_color_info, 0);
|
25
27
|
}
|
28
|
+
|
26
29
|
void jpeg_jpeg_exit(j_common_ptr jpeg) {
|
27
30
|
char buffer[JMSG_LENGTH_MAX];
|
28
31
|
jpeg->err->format_message(jpeg, buffer);
|
@@ -102,3 +105,10 @@ static VALUE jpeg_jpeg_size(VALUE self) {
|
|
102
105
|
|
103
106
|
return array;
|
104
107
|
}
|
108
|
+
|
109
|
+
static VALUE jpeg_jpeg_color_info(VALUE self) {
|
110
|
+
struct jpeg_jpeg *p_jpeg;
|
111
|
+
|
112
|
+
Data_Get_Struct(self, struct jpeg_jpeg, p_jpeg);
|
113
|
+
return ID2SYM(rb_intern( p_jpeg->read->out_color_components == 3 ? "rgb" : "gray" ));
|
114
|
+
}
|
data/jpeg.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "jpeg"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["masarakki"]
|
12
|
-
s.date = "2012-04-
|
12
|
+
s.date = "2012-04-07"
|
13
13
|
s.description = "libjpeg wrapper for ruby"
|
14
14
|
s.email = "masaki@hisme.net"
|
15
15
|
s.extensions = ["ext/extconf.rb"]
|
data/lib/jpeg.rb
CHANGED
data/spec/jpeg_spec.rb
CHANGED
@@ -12,6 +12,9 @@ describe "Jpeg" do
|
|
12
12
|
its(:size) { should == [112, 112] }
|
13
13
|
its(:width) { should == 112 }
|
14
14
|
its(:height) { should == 112 }
|
15
|
+
its(:color_info) { should == :rgb }
|
16
|
+
its(:rgb?) { should be_true }
|
17
|
+
its(:gray?) { should be_false }
|
15
18
|
end
|
16
19
|
context "non-exists file" do
|
17
20
|
it {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jpeg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -120,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
segments:
|
122
122
|
- 0
|
123
|
-
hash:
|
123
|
+
hash: -1032745497266643110
|
124
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
125
|
none: false
|
126
126
|
requirements:
|