chunky_png 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,15 +3,15 @@ require 'bundler/setup'
3
3
  require 'chunky_png'
4
4
 
5
5
  module PNGSuite
6
-
6
+
7
7
  def png_suite_file(kind, file)
8
8
  File.join(png_suite_dir(kind), file)
9
9
  end
10
-
10
+
11
11
  def png_suite_dir(kind)
12
12
  File.expand_path("./png_suite/#{kind}", File.dirname(__FILE__))
13
13
  end
14
-
14
+
15
15
  def png_suite_files(kind, pattern = '*.png')
16
16
  Dir[File.join(png_suite_dir(kind), pattern)]
17
17
  end
@@ -19,25 +19,25 @@ end
19
19
 
20
20
 
21
21
  module ResourceFileHelper
22
-
22
+
23
23
  def resource_file(name)
24
24
  File.expand_path("./resources/#{name}", File.dirname(__FILE__))
25
- end
26
-
25
+ end
26
+
27
27
  def resource_data(name)
28
28
  data = nil
29
- File.open(resource_file(name), 'rb') { |f| data = f.read }
29
+ File.open(resource_file(name), 'rb') { |f| data = f.read }
30
30
  data
31
31
  end
32
-
32
+
33
33
  def reference_canvas(name)
34
34
  ChunkyPNG::Canvas.from_file(resource_file("#{name}.png"))
35
35
  end
36
-
36
+
37
37
  def reference_image(name)
38
38
  ChunkyPNG::Image.from_file(resource_file("#{name}.png"))
39
39
  end
40
-
40
+
41
41
  def display(png)
42
42
  filename = resource_file('_tmp.png')
43
43
  png.save(filename)
@@ -49,4 +49,8 @@ RSpec.configure do |config|
49
49
  config.extend PNGSuite
50
50
  config.include PNGSuite
51
51
  config.include ResourceFileHelper
52
+
53
+ config.expect_with :rspec do |c|
54
+ c.syntax = [:should, :expect]
55
+ end
52
56
  end
metadata CHANGED
@@ -1,68 +1,72 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chunky_png
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-18 00:00:00.000000000 Z
11
+ date: 2014-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.2'
33
+ version: '3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.2'
41
- description: " This pure Ruby library can read and write PNG images without depending
42
- on an external \n image library, like RMagick. It tries to be memory efficient
43
- and reasonably fast.\n \n It supports reading and writing all PNG variants
44
- that are defined in the specification, \n with one limitation: only 8-bit color
45
- depth is supported. It supports all transparency, \n interlacing and filtering
46
- options the PNG specifications allows. It can also read and \n write textual
47
- metadata from PNG files. Low-level read/write access to PNG chunks is\n also
48
- possible.\n \n This library supports simple drawing on the image canvas and
49
- simple operations like\n alpha composition and cropping. Finally, it can import
50
- from and export to RMagick for \n interoperability.\n \n Also, have a look
51
- at OilyPNG at http://github.com/wvanbergen/oily_png. OilyPNG is a \n drop in
52
- mixin module that implements some of the ChunkyPNG algorithms in C, which \n provides
53
- a massive speed boost to encoding and decoding.\n"
40
+ version: '3'
41
+ description: |2
42
+ This pure Ruby library can read and write PNG images without depending on an external
43
+ image library, like RMagick. It tries to be memory efficient and reasonably fast.
44
+
45
+ It supports reading and writing all PNG variants that are defined in the specification,
46
+ with one limitation: only 8-bit color depth is supported. It supports all transparency,
47
+ interlacing and filtering options the PNG specifications allows. It can also read and
48
+ write textual metadata from PNG files. Low-level read/write access to PNG chunks is
49
+ also possible.
50
+
51
+ This library supports simple drawing on the image canvas and simple operations like
52
+ alpha composition and cropping. Finally, it can import from and export to RMagick for
53
+ interoperability.
54
+
55
+ Also, have a look at OilyPNG at http://github.com/wvanbergen/oily_png. OilyPNG is a
56
+ drop in mixin module that implements some of the ChunkyPNG algorithms in C, which
57
+ provides a massive speed boost to encoding and decoding.
54
58
  email:
55
59
  - willem@railsdoctors.com
56
60
  executables: []
57
61
  extensions: []
58
62
  extra_rdoc_files:
59
63
  - README.rdoc
60
- - BENCHMARKS.rdoc
61
64
  files:
62
- - .gitignore
63
- - .travis.yml
64
- - .yardopts
65
- - BENCHMARKS.rdoc
65
+ - ".gitignore"
66
+ - ".travis.yml"
67
+ - ".yardopts"
68
+ - BENCHMARKING.md
69
+ - CONTRIBUTING.md
66
70
  - Gemfile
67
71
  - LICENSE
68
72
  - README.rdoc
@@ -384,27 +388,27 @@ licenses:
384
388
  metadata: {}
385
389
  post_install_message:
386
390
  rdoc_options:
387
- - --title
391
+ - "--title"
388
392
  - chunky_png
389
- - --main
393
+ - "--main"
390
394
  - README.rdoc
391
- - --line-numbers
392
- - --inline-source
395
+ - "--line-numbers"
396
+ - "--inline-source"
393
397
  require_paths:
394
398
  - lib
395
399
  required_ruby_version: !ruby/object:Gem::Requirement
396
400
  requirements:
397
- - - '>='
401
+ - - ">="
398
402
  - !ruby/object:Gem::Version
399
403
  version: '0'
400
404
  required_rubygems_version: !ruby/object:Gem::Requirement
401
405
  requirements:
402
- - - '>='
406
+ - - ">="
403
407
  - !ruby/object:Gem::Version
404
408
  version: '0'
405
409
  requirements: []
406
410
  rubyforge_project:
407
- rubygems_version: 2.0.14
411
+ rubygems_version: 2.2.2
408
412
  signing_key:
409
413
  specification_version: 4
410
414
  summary: Pure ruby library for read/write, chunk-level access to PNG files
@@ -1,31 +0,0 @@
1
- = ChunkyPNG benchmark suite
2
-
3
- This small benchmark suite is intended to test the speed of PNG decoding
4
- and encoding against different ruby interpreters. You can set the number
5
- of runs by passing the N environment variable. You can execute them as
6
- rake task or as standalone script.
7
-
8
- rake benchmark:encoding
9
- rake benchmark:decoding
10
-
11
- rake benchmark N=10 # Run all of them, using n=10
12
-
13
- Use rvm to simply run the tests against different interpreters. Of course,
14
- make sure that the chunky_png is installed for all your interpreters.
15
-
16
- rvm 1.8.7,1.9.3,rbx rake benchmark N=10
17
-
18
- == Results
19
-
20
- Some of my benchmark (N=50) result on my 2007 iMac can be found in this gist:
21
- http://gist.github.com/495323
22
-
23
- == Why is this relevant?
24
-
25
- ChunkyPNG is a pure Ruby library to handle PNG files. Decoding a PNG requires
26
- a lot of integer math and bitwise operations, and moderate use of the unpack
27
- method to read binary data. Encoding is a good test for Array#pack, and
28
- depending on the encoding options, also requires a lot of calculations.
29
- Therefore, the library is a good benchmark candidate for these methods and
30
- algorithms. It has been used to improve the Array#pack and String#unpack
31
- methods in Rubinius.