oily_png 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oily_png (0.0.4)
4
+ oily_png (0.0.5)
5
5
  chunky_png (~> 0.10.2)
6
6
 
7
7
  GEM
data/README.rdoc CHANGED
@@ -1,11 +1,9 @@
1
1
  = OilyPNG
2
2
 
3
3
  OilyPNG is a Ruby C extension to speed up the pure Ruby ChunkyPNG library. It is a standalone
4
- module, so it does not require LibPNG, ImageMagick or any other library.
5
-
6
- Currently it has an alternative implementation of decoding PNGs, making that operation much
7
- faster for PNG images that apply filtering. An alternative implementation for encoding is
8
- planned.
4
+ module, so it does not require LibPNG, ImageMagick or any other library. Currently it has an
5
+ alternative implementation of decoding and encoding PNGs, making these operations much
6
+ faster for PNG images that apply filtering.
9
7
 
10
8
  *Warning*: this is my first C code in years. It may blow up your PC after leaking memory all
11
9
  over the place, killing a kitten in the process. You have been warned.
@@ -88,6 +88,10 @@ VALUE oily_png_encode_png_image_pass_to_stream(VALUE self, VALUE stream, VALUE c
88
88
  int height = FIX2INT(rb_funcall(self, rb_intern("height"), 0));
89
89
  VALUE pixels = rb_funcall(self, rb_intern("pixels"), 0);
90
90
 
91
+ if (RARRAY_LEN(pixels) != width * height) {
92
+ exit(1);
93
+ }
94
+
91
95
  VALUE palette = Qnil;
92
96
  if (FIX2INT(color_mode) == OILY_PNG_COLOR_INDEXED) {
93
97
  palette = rb_funcall(self, rb_intern("encoding_palette"), 0);
data/lib/oily_png.rb CHANGED
@@ -2,11 +2,11 @@ require 'chunky_png'
2
2
 
3
3
  module OilyPNG
4
4
 
5
- VERSION = "0.0.4"
5
+ VERSION = "0.0.5"
6
6
 
7
7
  def self.included(base)
8
- base::Canvas.extend OilyPNG::PNGDecoding
9
- base::Canvas.include OilyPNG::PNGEncoding
8
+ base::Canvas.send(:extend, OilyPNG::PNGDecoding)
9
+ base::Canvas.send(:include, OilyPNG::PNGEncoding)
10
10
  end
11
11
 
12
12
  end
data/oily_png.gemspec CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
 
5
5
  # Do not change the version and date fields by hand. This will be done
6
6
  # automatically by the gem release script.
7
- s.version = "0.0.4"
7
+ s.version = "0.0.5"
8
8
  s.date = "2010-10-05"
9
9
 
10
10
  s.summary = "Native mixin to speed up ChunkyPNG"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oily_png
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Willem van Bergen