Versions in this module Expand all Collapse all v1 v1.0.1 Jun 30, 2026 v1.0.0 Jun 30, 2026 Changes in this version + const BoxTypeBPC + const BoxTypeChanDef + const BoxTypeCodestream + const BoxTypeColourSpec + const BoxTypeCompMap + const BoxTypeFileType + const BoxTypeImageHeader + const BoxTypeJP2Header + const BoxTypePalette + const BoxTypeResolution + const BoxTypeSignature + const BoxTypeUUID + const BoxTypeUUIDInfo + const BoxTypeXML + const BrandJP2 + const BrandJPX + const ColourSpaceGrey + const ColourSpaceSRGB + const ColourSpaceSYCC + const JP2SignatureLength + const MarkerEOC + const MarkerSOC + const MarkerSOD + const MarkerSOT + const MaxBoxCount + const MaxBoxLength + const MaxBoxRecursionDepth + const MaxComponentCount + const MaxImageDimension + const MinImageDimension + var ErrBoxCountExceeded = errors.New("maximum box count exceeded") + var ErrInvalidBoxLength = errors.New("invalid box length") + var ErrInvalidBoxType = errors.New("invalid box type") + var ErrInvalidColourSpec = errors.New("invalid colour specification") + var ErrInvalidImageHeader = errors.New("invalid image header") + var ErrInvalidJP2Signature = errors.New("invalid JP2 signature") + var ErrMissingRequiredBox = errors.New("missing required box") + var ErrNoCodestream = errors.New("no codestream found") + var ErrRecursionDepthExceeded = errors.New("box recursion depth exceeded") + var ErrUnexpectedEOF = errors.New("unexpected end of file") + var J2KSignature = []byte + var JP2Signature = []byte + type Box struct + Children []*Box + Data []byte + Length uint64 + Offset int64 + Type uint32 + func (b *Box) TypeString() string + type ColourSpec struct + Approx uint8 + EnumCS uint32 + ICCProfile []byte + Method uint8 + Precedence uint8 + type FileType struct + Brand uint32 + Compatibility []uint32 + MinorVersion uint32 + type ImageHeader struct + BitsPerComp uint8 + CompressionType uint8 + Height uint32 + IntellProp uint8 + NumComponents uint16 + UnknownColour uint8 + Width uint32 + type JP2File struct + Boxes []*Box + Codestream []byte + FileType *FileType + Header *JP2Header + IsRawJ2K bool + Signature *Box + type JP2Header struct + BPC *Box + ChanDef *Box + ColourSpec *ColourSpec + CompMap *Box + ImageHeader *ImageHeader + Palette *Box + Resolution *Box + type Parser struct + func NewParser() *Parser + func (p *Parser) IsJP2(data []byte) bool + func (p *Parser) IsRawJ2K(data []byte) bool + func (p *Parser) Parse(r io.Reader) (*JP2File, error) + func (p *Parser) ParseBox(r io.ReadSeeker, offset int64, _ int) (*Box, error) + func (p *Parser) ParseColourSpec(box *Box) (*ColourSpec, error) + func (p *Parser) ParseFileType(box *Box) (*FileType, error) + func (p *Parser) ParseImageHeader(box *Box) (*ImageHeader, error) + func (p *Parser) ParseJP2Header(box *Box) (*JP2Header, error) + func (p *Parser) ParseSuperboxChildren(box *Box, depth int) error + func (p *Parser) Reset() + func (p *Parser) ValidateSignature(data []byte) error