chunky_png 1.2.6 → 1.2.7
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/.gitignore +2 -1
- data/.travis.yml +6 -1
- data/chunky_png.gemspec +2 -2
- data/lib/chunky_png.rb +1 -1
- data/lib/chunky_png/canvas/png_decoding.rb +2 -24
- data/spec/png_suite/basic/basi0g04.rgba +0 -0
- data/spec/png_suite/basic/basn0g04.rgba +0 -0
- metadata +6 -6
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
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 = "1.2.
|
7
|
-
s.date = "
|
6
|
+
s.version = "1.2.7"
|
7
|
+
s.date = "2013-01-07"
|
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
@@ -25,7 +25,7 @@ module ChunkyPNG
|
|
25
25
|
|
26
26
|
# The current version of ChunkyPNG. This value will be updated
|
27
27
|
# automatically by them <tt>gem:release</tt> rake task.
|
28
|
-
VERSION = "1.2.
|
28
|
+
VERSION = "1.2.7"
|
29
29
|
|
30
30
|
###################################################
|
31
31
|
# PNG international standard defined constants
|
@@ -191,36 +191,14 @@ module ChunkyPNG
|
|
191
191
|
# @param [Integer] value The 4 bit value to resample.
|
192
192
|
# @return [Integer] The 8 bit resampled value.
|
193
193
|
def decode_png_resample_4bit_value(value)
|
194
|
-
|
195
|
-
when 0x00; 0
|
196
|
-
when 0x01; 17
|
197
|
-
when 0x02; 34
|
198
|
-
when 0x03; 51
|
199
|
-
when 0x04; 68
|
200
|
-
when 0x05; 85
|
201
|
-
when 0x06; 102
|
202
|
-
when 0x07; 119
|
203
|
-
when 0x08; 137
|
204
|
-
when 0x09; 154
|
205
|
-
when 0x0a; 171
|
206
|
-
when 0x0b; 188
|
207
|
-
when 0x0c; 205
|
208
|
-
when 0x0d; 222
|
209
|
-
when 0x0e; 239
|
210
|
-
when 0x0f; 255
|
211
|
-
end
|
194
|
+
value << 4 | value
|
212
195
|
end
|
213
196
|
|
214
197
|
# Resamples a 2 bit value to an 8 bit value.
|
215
198
|
# @param [Integer] value The 2 bit value to resample.
|
216
199
|
# @return [Integer] The 8 bit resampled value.
|
217
200
|
def decode_png_resample_2bit_value(value)
|
218
|
-
|
219
|
-
when 0x00; 0x00
|
220
|
-
when 0x01; 0x55
|
221
|
-
when 0x02; 0xaa
|
222
|
-
when 0x03; 0xff
|
223
|
-
end
|
201
|
+
value << 6 | value << 4 | value << 2 | value
|
224
202
|
end
|
225
203
|
|
226
204
|
# Resamples a 1 bit value to an 8 bit value.
|
Binary file
|
Binary file
|
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: 1.2.
|
4
|
+
version: 1.2.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70321860376960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70321860376960
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70321860390920 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '2.2'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70321860390920
|
36
36
|
description: ! " This pure Ruby library can read and write PNG images without depending
|
37
37
|
on an external \n image library, like RMagick. It tries to be memory efficient
|
38
38
|
and reasonably fast.\n \n It supports reading and writing all PNG variants
|