chunky_png 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- data/chunky_png.gemspec +2 -2
- data/lib/chunky_png.rb +1 -1
- data/lib/chunky_png/chunk.rb +1 -1
- data/spec/chunky_png/rmagick_spec.rb +17 -13
- metadata +2 -2
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.5.
|
7
|
-
s.date = "2010-02-
|
6
|
+
s.version = "0.5.7"
|
7
|
+
s.date = "2010-02-24"
|
8
8
|
|
9
9
|
s.summary = "Pure ruby library for read/write, chunk-level access to PNG files"
|
10
10
|
s.description = <<-EOT
|
data/lib/chunky_png.rb
CHANGED
@@ -26,7 +26,7 @@ module ChunkyPNG
|
|
26
26
|
|
27
27
|
# The current version of ChunkyPNG. This value will be updated automatically
|
28
28
|
# by them gem:release rake task.
|
29
|
-
VERSION = "0.5.
|
29
|
+
VERSION = "0.5.7"
|
30
30
|
|
31
31
|
###################################################
|
32
32
|
# PNG international standard defined constants
|
data/lib/chunky_png/chunk.rb
CHANGED
@@ -188,7 +188,7 @@ module ChunkyPNG
|
|
188
188
|
class ImageData < Generic
|
189
189
|
|
190
190
|
def self.combine_chunks(data_chunks)
|
191
|
-
Zlib::Inflate.inflate(data_chunks.map
|
191
|
+
Zlib::Inflate.inflate(data_chunks.map { |c| c.content }.join(''))
|
192
192
|
end
|
193
193
|
|
194
194
|
def self.split_in_chunks(data, chunk_size = 2147483647)
|
@@ -1,19 +1,23 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
3
|
+
begin
|
4
|
+
require 'chunky_png/rmagick'
|
4
5
|
|
5
|
-
describe ChunkyPNG::RMagick do
|
6
|
+
describe ChunkyPNG::RMagick do
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
it "should import an image from RMagick correctly" do
|
9
|
+
image = Magick::Image.read(resource_file('16x16_non_interlaced.png')).first
|
10
|
+
canvas = ChunkyPNG::RMagick.import(image)
|
11
|
+
canvas.should == reference_canvas('16x16_non_interlaced')
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
it "should export an image to RMagick correctly" do
|
15
|
+
canvas = reference_canvas('16x16_non_interlaced')
|
16
|
+
image = ChunkyPNG::RMagick.export(canvas)
|
17
|
+
image.format = 'PNG32'
|
18
|
+
canvas.should == ChunkyPNG::Canvas.from_blob(image.to_blob)
|
19
|
+
end
|
18
20
|
end
|
19
|
-
|
21
|
+
rescue LoadError => e
|
22
|
+
# skipping RMagick tests
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chunky_png
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willem van Bergen
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-24 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|