png

package
v0.0.0-...-ddbbca1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Length     uint32
	Type       string
	DataOffset int64
}

Chunk represents a PNG chunk

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser parses PNG image files.

Supported metadata:

  • EXIF (eXIf chunk)
  • XMP (iTXt chunk with keyword "XML:com.adobe.xmp")
  • ICC Profile (iCCP chunk)
  • Text metadata (tEXt, zTXt, iTXt chunks)

PNG uses a chunk-based format.

func New

func New() *Parser

New creates a new PNG parser

func (*Parser) Detect

func (p *Parser) Detect(r io.ReaderAt) bool

Detect checks if the data is a PNG file

func (*Parser) Name

func (p *Parser) Name() string

Name returns the parser name

func (*Parser) Parse

func (p *Parser) Parse(r io.ReaderAt) ([]parser.Directory, *parser.ParseError)

Parse extracts metadata from a PNG file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL