tayloraswift / swift-png

decode, inspect, edit, and encode png images in pure swift

Home Page:https://swiftinit.org/docs/swift-png

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Chunk Reading?

amiantos opened this issue · comments

Sometimes there may be data embedded in custom chunks in an image. How would one use swift-png to check for these custom chunks? For example, TavernAI uses PNG cards that have a base64 string encoded into a "chara" chunk. How would I get this using swift-png? Sorry, I know this is an issue and not a support forum, but I'm stumped!

For example, for this PNG, this text chunk named "chara" does not appear in the swift-png metadata object.

image

Well... I'm embarrassed. Apparently as I copied the PNG into my Xcode project, macOS or something was editing the PNG and removing the other data. If I download the data from a server and load it in, the text headers appear and I can fetch them. Nevermind.