lib/chunky_png/chunk.rb in chunky_png-0.10.3 vs lib/chunky_png/chunk.rb in chunky_png-0.10.4

- old
+ new

@@ -156,17 +156,17 @@ # @param [String] type The four character chunk type indicator (= "IEND"). # @param [String] content The content read from the chunk. Should be empty. # @return [ChunkyPNG::Chunk::End] The new End chunk instance. # @raise [RuntimeError] Raises an exception if the content was not empty. def self.read(type, content) - raise 'The IEND chunk should be empty!' if content != '' + raise 'The IEND chunk should be empty!' if content.bytesize > 0 self.new end # Returns an empty string, because this chunk should always be empty. # @return [""] An empty string. def content - '' + ChunkyPNG::Datastream.empty_bytearray end end # The Palette (PLTE) chunk contains the image's palette, i.e. the # 8-bit RGB colors this image is using.