chunky_png 0.0.4 → 0.0.5

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/chunky_png.gemspec CHANGED
@@ -3,7 +3,7 @@ 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.0.4"
6
+ s.version = "0.0.5"
7
7
  s.date = "2010-01-13"
8
8
 
9
9
  s.summary = "Pure ruby library for read/write, chunk-level access to PNG files"
data/lib/chunky_png.rb CHANGED
@@ -46,7 +46,7 @@ module ChunkyPNG
46
46
  end
47
47
 
48
48
  def load_from_file(file)
49
- File.open(file, 'r') { |f| load_from_io(f) }
49
+ File.open(file, 'rb') { |f| load_from_io(f) }
50
50
  end
51
51
 
52
52
  def load_from_memory(string)
@@ -121,7 +121,7 @@ module ChunkyPNG
121
121
  # @return [Fixnum] The 0-based position of the color in the palette.
122
122
  # @see ChunkyPNG::Palette#can_encode?
123
123
  def index(color)
124
- @encoding_map[color]
124
+ @encoding_map[ChunkyPNG::Pixel.new(color)]
125
125
  end
126
126
 
127
127
  # Creates a tRNS chunk that corresponds with this palette to store the
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.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen