chunky_png 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -3
- data/chunky_png.gemspec +2 -3
- data/lib/chunky_png.rb +1 -1
- data/lib/chunky_png/canvas/png_decoding.rb +1 -1
- data/spec/chunky_png/canvas/adam7_interlacing_spec.rb +2 -4
- data/spec/spec_helper.rb +4 -0
- metadata +10 -35
data/Gemfile.lock
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
chunky_png (0.9.
|
4
|
+
chunky_png (0.9.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: http://rubygems.org/
|
8
8
|
specs:
|
9
|
-
gemcutter (0.6.1)
|
10
9
|
git (1.2.5)
|
11
10
|
rake (0.8.7)
|
12
11
|
rspec (1.3.0)
|
@@ -16,7 +15,6 @@ PLATFORMS
|
|
16
15
|
|
17
16
|
DEPENDENCIES
|
18
17
|
chunky_png!
|
19
|
-
gemcutter
|
20
18
|
git
|
21
19
|
rake
|
22
20
|
rspec (>= 1.3)
|
data/chunky_png.gemspec
CHANGED
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
|
|
3
3
|
|
4
4
|
# Do not change the version and date fields by hand. This will be done
|
5
5
|
# automatically by the gem release script.
|
6
|
-
s.version = "0.9.
|
7
|
-
s.date = "2010-09-
|
6
|
+
s.version = "0.9.2"
|
7
|
+
s.date = "2010-09-17"
|
8
8
|
|
9
9
|
s.summary = "Pure ruby library for read/write, chunk-level access to PNG files"
|
10
10
|
s.description = <<-EOT
|
@@ -28,7 +28,6 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_development_dependency('rake')
|
29
29
|
s.add_development_dependency('rspec', '>= 1.3')
|
30
30
|
s.add_development_dependency('git')
|
31
|
-
s.add_development_dependency('gemcutter')
|
32
31
|
|
33
32
|
s.rdoc_options << '--title' << s.name << '--main' << 'README.rdoc' << '--line-numbers' << '--inline-source'
|
34
33
|
s.extra_rdoc_files = ['README.rdoc', 'BENCHMARKS.rdoc']
|
data/lib/chunky_png.rb
CHANGED
@@ -27,7 +27,7 @@ module ChunkyPNG
|
|
27
27
|
|
28
28
|
# The current version of ChunkyPNG. This value will be updated automatically
|
29
29
|
# by them gem:release rake task.
|
30
|
-
VERSION = "0.9.
|
30
|
+
VERSION = "0.9.2"
|
31
31
|
|
32
32
|
###################################################
|
33
33
|
# PNG international standard defined constants
|
@@ -113,7 +113,7 @@ module ChunkyPNG
|
|
113
113
|
# @param color_mode (see ChunkyPNG::Canvas::PNGDecoding#decode_png_pixelstream)
|
114
114
|
# @return (see ChunkyPNG::Canvas::PNGDecoding#decode_png_pixelstream)
|
115
115
|
def decode_png_with_adam7_interlacing(stream, width, height, color_mode)
|
116
|
-
canvas =
|
116
|
+
canvas = new(width, height)
|
117
117
|
pixel_size = Color.bytesize(color_mode)
|
118
118
|
start_pos = 0
|
119
119
|
for pass in 0...7 do
|
@@ -73,8 +73,6 @@ describe ChunkyPNG::Canvas::Adam7Interlacing do
|
|
73
73
|
end
|
74
74
|
|
75
75
|
describe '#adam7_merge_pass' do
|
76
|
-
before(:each) { @reference = reference_canvas('adam7') }
|
77
|
-
|
78
76
|
it "should merge the submatrices correctly" do
|
79
77
|
submatrices = [
|
80
78
|
ChunkyPNG::Canvas.new(1, 1, 168430335), # r = 10
|
@@ -86,9 +84,9 @@ describe ChunkyPNG::Canvas::Adam7Interlacing do
|
|
86
84
|
ChunkyPNG::Canvas.new(8, 4, 1175063295), # r = 70
|
87
85
|
]
|
88
86
|
|
89
|
-
canvas = ChunkyPNG::
|
87
|
+
canvas = ChunkyPNG::Image.new(8,8)
|
90
88
|
submatrices.each_with_index { |m, pass| adam7_merge_pass(pass, canvas, m) }
|
91
|
-
canvas.should ==
|
89
|
+
canvas.should == reference_image('adam7')
|
92
90
|
end
|
93
91
|
end
|
94
92
|
|
data/spec/spec_helper.rb
CHANGED
@@ -25,6 +25,10 @@ module MatrixSpecHelper
|
|
25
25
|
def reference_canvas(name)
|
26
26
|
ChunkyPNG::Canvas.from_file(resource_file("#{name}.png"))
|
27
27
|
end
|
28
|
+
|
29
|
+
def reference_image(name)
|
30
|
+
ChunkyPNG::Image.from_file(resource_file("#{name}.png"))
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
Spec::Runner.configure do |config|
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chunky_png
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 57
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
8
|
+
- 2
|
9
|
+
version: 0.9.2
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Willem van Bergen
|
@@ -15,66 +14,46 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-17 00:00:00 +02:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
21
|
+
prerelease: false
|
22
|
+
type: :development
|
22
23
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
-
none: false
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
hash: 3
|
28
27
|
segments:
|
29
28
|
- 0
|
30
29
|
version: "0"
|
31
30
|
requirement: *id001
|
32
|
-
type: :development
|
33
31
|
name: rake
|
34
|
-
prerelease: false
|
35
32
|
- !ruby/object:Gem::Dependency
|
33
|
+
prerelease: false
|
34
|
+
type: :development
|
36
35
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
36
|
requirements:
|
39
37
|
- - ">="
|
40
38
|
- !ruby/object:Gem::Version
|
41
|
-
hash: 9
|
42
39
|
segments:
|
43
40
|
- 1
|
44
41
|
- 3
|
45
42
|
version: "1.3"
|
46
43
|
requirement: *id002
|
47
|
-
type: :development
|
48
44
|
name: rspec
|
49
|
-
prerelease: false
|
50
45
|
- !ruby/object:Gem::Dependency
|
46
|
+
prerelease: false
|
47
|
+
type: :development
|
51
48
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
49
|
requirements:
|
54
50
|
- - ">="
|
55
51
|
- !ruby/object:Gem::Version
|
56
|
-
hash: 3
|
57
52
|
segments:
|
58
53
|
- 0
|
59
54
|
version: "0"
|
60
55
|
requirement: *id003
|
61
|
-
type: :development
|
62
56
|
name: git
|
63
|
-
prerelease: false
|
64
|
-
- !ruby/object:Gem::Dependency
|
65
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
|
-
requirements:
|
68
|
-
- - ">="
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
hash: 3
|
71
|
-
segments:
|
72
|
-
- 0
|
73
|
-
version: "0"
|
74
|
-
requirement: *id004
|
75
|
-
type: :development
|
76
|
-
name: gemcutter
|
77
|
-
prerelease: false
|
78
57
|
description: " This pure Ruby library can read and write PNG images without depending on an external \n image library, like RMagick. It tries to be memory efficient and reasonably fast.\n \n It supports reading and writing all PNG variants that are defined in the specification, \n with one limitation: only 8-bit color depth is supported. It supports all transparency, \n interlacing and filtering options the PNG specifications allows. It can also read and \n write textual metadata from PNG files. Low-level read/write access to PNG chunks is\n also possible.\n \n This library supports simple drawing on the image canvas and simple operations like alpha composition\n and cropping. Finally, it can import from and export to RMagick for interoperability. \n"
|
79
58
|
email:
|
80
59
|
- willem@railsdoctors.com
|
@@ -175,27 +154,23 @@ rdoc_options:
|
|
175
154
|
require_paths:
|
176
155
|
- lib
|
177
156
|
required_ruby_version: !ruby/object:Gem::Requirement
|
178
|
-
none: false
|
179
157
|
requirements:
|
180
158
|
- - ">="
|
181
159
|
- !ruby/object:Gem::Version
|
182
|
-
hash: 3
|
183
160
|
segments:
|
184
161
|
- 0
|
185
162
|
version: "0"
|
186
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
|
-
none: false
|
188
164
|
requirements:
|
189
165
|
- - ">="
|
190
166
|
- !ruby/object:Gem::Version
|
191
|
-
hash: 3
|
192
167
|
segments:
|
193
168
|
- 0
|
194
169
|
version: "0"
|
195
170
|
requirements: []
|
196
171
|
|
197
172
|
rubyforge_project:
|
198
|
-
rubygems_version: 1.3.
|
173
|
+
rubygems_version: 1.3.6
|
199
174
|
signing_key:
|
200
175
|
specification_version: 3
|
201
176
|
summary: Pure ruby library for read/write, chunk-level access to PNG files
|