lib/ase/writer.rb in ase-1.0.2 vs lib/ase/writer.rb in ase-1.0.3
- old
+ new
@@ -7,11 +7,11 @@
def write!
raise "Must specify an output file" if @file.nil?
@file = File.new(@file, 'wb')
- palette_count = @palettes.length
- color_count = @palettes.inject(0) { |sum, p| p.size }
+ palette_count = @palettes.keys.length
+ color_count = @palettes.values.map{ |p| p.size }.inject { |sum, i| sum + i }
# Signature
@file.write "ASEF"
# Version
\ No newline at end of file