Initializerswift-png 4.4.5PNG
init(parsing:unicode:)
Creates a text comment by parsing the given chunk data, interpreting it either as a unicode text chunk, or a latin-1 text chunk.
PNG.Text.swift:110init(parsing data: [UInt8], unicode: Bool = true) throws
Parameters
- data
- unicode
Specifies if the given chunk
data
should be interpreted as a unicode chunk, or a latin-1 chunk. It should be set totrue
if the original text chunk was aniTXt
chunk, andfalse
otherwise. The default value istrue
.If this flag is set to
false
, the text is assumed to be in english, and thelanguage
tag will be set to["en"]
.
Other members in extension
Type members
init(compressed: Bool, keyword: (english: String, localized: String), language: [String], content: String
) Creates a text comment.
Instance members
let compressed: Bool
Indicates if the text is (or is to be) stored in compressed or uncompressed form within a PNG file.
let content: String
The text content.
var description: String
let keyword: (english: String, localized: String)
A keyword tag, in english, and possibly a non-english language.
let language: [String]
A keyword tag, in english, and possibly a non-english language.
var serialized: [UInt8]
Encodes this text comment as the contents of a
iTXt
chunk.