Class: Libpng::TextEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/libpng/text_writer.rb

Overview

One user-supplied text entry, normalized. The encoder decides whether to emit it as tEXt (Latin-1 ASCII) or iTXt (UTF-8 with potentially multibyte characters) based on whether the value contains non-ASCII bytes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



8
9
10
# File 'lib/libpng/text_writer.rb', line 8

def key
  @key
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



8
9
10
# File 'lib/libpng/text_writer.rb', line 8

def value
  @value
end

Instance Method Details

#compressionObject



9
10
11
# File 'lib/libpng/text_writer.rb', line 9

def compression
  value.ascii_only? ? TEXT_COMPRESSION_NONE : TEXT_COMPRESSION_ITXT_KEY
end