jpeg 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/ext/jpeg_jpeg.c CHANGED
@@ -20,6 +20,11 @@ void Init_jpeg_jpeg() {
20
20
  rb_define_method(Jpeg, "height", jpeg_jpeg_height, 0);
21
21
  rb_define_method(Jpeg, "size", jpeg_jpeg_size, 0);
22
22
  }
23
+ void jpeg_jpeg_exit(j_common_ptr jpeg) {
24
+ char buffer[JMSG_LENGTH_MAX];
25
+ jpeg->err->format_message(jpeg, buffer);
26
+ rb_raise(rb_eRuntimeError, buffer);
27
+ }
23
28
 
24
29
  static VALUE jpeg_jpeg_alloc(VALUE klass) {
25
30
  struct jpeg_jpeg *jpeg = ALLOC(struct jpeg_jpeg);
@@ -27,6 +32,7 @@ static VALUE jpeg_jpeg_alloc(VALUE klass) {
27
32
  jpeg->read = (void *)ALLOC(struct jpeg_decompress_struct);
28
33
  jpeg->error = (void *)ALLOC(struct jpeg_error_mgr);
29
34
  jpeg->read->err = jpeg_std_error(jpeg->error);
35
+ jpeg->error->error_exit = jpeg_jpeg_exit;
30
36
  jpeg_create_decompress(jpeg->read);
31
37
 
32
38
  return Data_Wrap_Struct(klass, jpeg_jpeg_mark, jpeg_jpeg_free, jpeg);
@@ -38,7 +44,7 @@ static void jpeg_jpeg_mark(struct jpeg_jpeg *p) {
38
44
 
39
45
  static void jpeg_jpeg_free(struct jpeg_jpeg *p) {
40
46
  if (p->read) {
41
- jpeg_destroy_compress(p->read);
47
+ jpeg_destroy_decompress(p->read);
42
48
  free(p->read);
43
49
  }
44
50
  if (p->error) {
@@ -63,6 +69,7 @@ static VALUE jpeg_jpeg_s_open(int argc, VALUE *argv, VALUE self) {
63
69
  rb_raise(rb_eRuntimeError, "Open file failed");
64
70
  }
65
71
  jpeg_stdio_src(p_jpeg->read, fp);
72
+
66
73
  jpeg_read_header(p_jpeg->read, TRUE);
67
74
  jpeg_start_decompress(p_jpeg->read);
68
75
  fclose(fp);
data/jpeg.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "jpeg"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["masarakki"]
@@ -35,12 +35,13 @@ Gem::Specification.new do |s|
35
35
  "lib/jpeg.rb",
36
36
  "spec/jpeg_spec.rb",
37
37
  "spec/samples/sample.jpg",
38
+ "spec/samples/sample.png",
38
39
  "spec/spec_helper.rb"
39
40
  ]
40
41
  s.homepage = "http://github.com/masarakki/jpeg"
41
42
  s.licenses = ["MIT"]
42
43
  s.require_paths = ["lib"]
43
- s.rubygems_version = "1.8.21"
44
+ s.rubygems_version = "1.8.10"
44
45
  s.summary = "libjpeg wrapper for ruby"
45
46
 
46
47
  if s.respond_to? :specification_version then
Binary file
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.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &84836770 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *84836770
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: rdoc
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &84836420 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '0'
38
33
  type: :development
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
35
+ version_requirements: *84836420
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: bundler
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &84835960 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ! '>='
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: '0'
54
44
  type: :development
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
46
+ version_requirements: *84835960
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: jeweler
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &84835420 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ! '>='
@@ -69,12 +54,7 @@ dependencies:
69
54
  version: '0'
70
55
  type: :development
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
57
+ version_requirements: *84835420
78
58
  description: libjpeg wrapper for ruby
79
59
  email: masaki@hisme.net
80
60
  executables: []
@@ -101,6 +81,7 @@ files:
101
81
  - lib/jpeg.rb
102
82
  - spec/jpeg_spec.rb
103
83
  - spec/samples/sample.jpg
84
+ - spec/samples/sample.png
104
85
  - spec/spec_helper.rb
105
86
  homepage: http://github.com/masarakki/jpeg
106
87
  licenses:
@@ -117,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
98
  version: '0'
118
99
  segments:
119
100
  - 0
120
- hash: -1096099433015947738
101
+ hash: -591377119
121
102
  required_rubygems_version: !ruby/object:Gem::Requirement
122
103
  none: false
123
104
  requirements:
@@ -126,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
107
  version: '0'
127
108
  requirements: []
128
109
  rubyforge_project:
129
- rubygems_version: 1.8.21
110
+ rubygems_version: 1.8.10
130
111
  signing_key:
131
112
  specification_version: 3
132
113
  summary: libjpeg wrapper for ruby