lib/chunky_png/datastream.rb in chunky_png-1.3.9 vs lib/chunky_png/datastream.rb in chunky_png-1.3.10
- old
+ new
@@ -141,10 +141,10 @@
# Returns all the textual metadata key/value pairs as hash.
# @return [Hash] A hash containing metadata fields and their values.
def metadata
metadata = {}
other_chunks.select do |chunk|
- metadata[chunk.keyword] = chunk.value if chunk.respond_to?(:keyword)
+ metadata[chunk.keyword] = chunk.value if chunk.respond_to?(:keyword) && chunk.respond_to?(:value)
end
metadata
end
# Returns the uncompressed image data, combined from all the IDAT chunks