chunky_png 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -5,5 +5,6 @@ spec/resources/_*.png
5
5
  /doc
6
6
  /.yardoc
7
7
  /.bundle
8
+ /_site
8
9
  Gemfile.lock
9
- *.rbc
10
+ test.*
@@ -1,11 +1,16 @@
1
1
  language: ruby
2
+ script: bundle exec rake
2
3
  rvm:
3
4
  - 1.8.7
4
5
  - 1.9.2
6
+ - 1.9.3
5
7
  - ruby-head
6
8
  - ree
7
9
  - rbx-18mode
8
10
  - rbx-19mode
9
11
  - jruby-18mode
10
12
  - jruby-19mode
11
-
13
+ matrix:
14
+ allow_failures:
15
+ - rvm: rbx-19mode
16
+ - rvm: ruby-head
@@ -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.6"
7
- s.date = "2012-08-07"
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
@@ -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.6"
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
- case value
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
- case value
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.
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.6
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: 2012-08-07 00:00:00.000000000 Z
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: &70146123334240 !ruby/object:Gem::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: *70146123334240
24
+ version_requirements: *70321860376960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70146123345040 !ruby/object:Gem::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: *70146123345040
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