Documentation ¶
Index ¶
- Constants
- Variables
- type ExifReader
- type Parser
- func (p *Parser) ParseASCII(data []byte, unitCount uint32) (value string, err error)
- func (p *Parser) ParseASCIINoNul(data []byte, unitCount uint32) (value string, err error)
- func (p *Parser) ParseBytes(data []byte, unitCount uint32) (value []uint8, err error)
- func (p *Parser) ParseLongs(data []byte, unitCount uint32, byteOrder binary.ByteOrder) (value []uint32, err error)
- func (p *Parser) ParseRationals(data []byte, unitCount uint32, byteOrder binary.ByteOrder) (value []Rational, err error)
- func (p *Parser) ParseShorts(data []byte, unitCount uint32, byteOrder binary.ByteOrder) (value []uint16, err error)
- func (p *Parser) ParseSignedLongs(data []byte, unitCount uint32, byteOrder binary.ByteOrder) (value []int32, err error)
- func (p *Parser) ParseSignedRationals(data []byte, unitCount uint32, byteOrder binary.ByteOrder) (value []SignedRational, err error)
- type Rational
- type SignedRational
- type Tag
- func (tag Tag) GetInt(exifReader ExifReader) (value int, err error)
- func (tag Tag) GetRational(exifReader ExifReader) (numerator int, denominator int, err error)
- func (tag Tag) GetRationals(exifReader ExifReader) (value []Rational, err error)
- func (tag Tag) GetString(exifReader io.ReaderAt) (value string, err error)
- func (tag Tag) GetUint16(exifReader ExifReader) (values []uint16, err error)
- func (tag *Tag) Set(ifdPath string, tagID TagID, unitCount uint32, valueOffset uint32, ...)
- type TagID
- type TagMap
- type TagType
Constants ¶
const ( TypeByteSize = 1 TypeASCIISize = 1 TypeASCIINoNulSize = 1 TypeShortSize = 2 TypeLongSize = 4 TypeRationalSize = 8 TypeSignedLongSize = 4 TypeSignedRationalSize = 8 )
Tag sizes
Variables ¶
var ( // ErrNotEnoughData is used when there isn't enough data to accomodate what // we're trying to parse (sizeof(type) * unit_count). ErrNotEnoughData = errors.New("not enough data for type") // ErrUnhandledUndefinedTypedTag is used when we try to parse a tag that's // recorded as an "unknown" type but not a documented tag (therefore // leaving us not knowning how to read it). ErrUnhandledUndefinedTypedTag = errors.New("not a standard unknown-typed tag") // ErrUnparseableValue is the error for a value that we should have been // able to parse but were not able to. ErrUnparseableValue = errors.New("unparseable undefined tag") )
var (
ErrEmptyTag = errors.New("Error empty tag")
)
Errors
Functions ¶
This section is empty.
Types ¶
type ExifReader ¶
ExifReader interface
type Parser ¶
type Parser struct{}
Parser knows how to parse all well-defined, encoded EXIF types.
func (*Parser) ParseASCII ¶
ParseASCII returns a string and auto-strips the trailing NUL character that should be at the end of the encoding. TODO: Add Test & Benchmark
func (*Parser) ParseASCIINoNul ¶
ParseASCIINoNul returns a string without any consideration for a trailing NUL character. TODO: Add Test & Benchmark
func (*Parser) ParseBytes ¶
TODO: Add Test & Benchmark
func (*Parser) ParseLongs ¶
func (p *Parser) ParseLongs(data []byte, unitCount uint32, byteOrder binary.ByteOrder) (value []uint32, err error)
ParseLongs knows how to encode an encoded list of unsigned longs. TODO: Add Test & Benchmark
func (*Parser) ParseRationals ¶
func (p *Parser) ParseRationals(data []byte, unitCount uint32, byteOrder binary.ByteOrder) (value []Rational, err error)
ParseRationals knows how to parse an encoded list of unsigned rationals. TODO: Add Test & Benchmark
func (*Parser) ParseShorts ¶
func (p *Parser) ParseShorts(data []byte, unitCount uint32, byteOrder binary.ByteOrder) (value []uint16, err error)
ParseShorts knows how to parse an encoded list of shorts. TODO: Add Test & Benchmark
func (*Parser) ParseSignedLongs ¶
func (p *Parser) ParseSignedLongs(data []byte, unitCount uint32, byteOrder binary.ByteOrder) (value []int32, err error)
ParseSignedLongs knows how to parse an encoded list of signed longs. TODO: Add Test & Benchmark
func (*Parser) ParseSignedRationals ¶
func (p *Parser) ParseSignedRationals(data []byte, unitCount uint32, byteOrder binary.ByteOrder) (value []SignedRational, err error)
ParseSignedRationals knows how to parse an encoded list of signed rationals. TODO: Add Test & Benchmark
type SignedRational ¶
SignedRational -
type Tag ¶
type Tag struct { Name string // contains filtered or unexported fields }
Tag - is an Exif Tag
func (Tag) GetInt ¶
func (tag Tag) GetInt(exifReader ExifReader) (value int, err error)
GetInt - WIP
func (Tag) GetRational ¶
func (tag Tag) GetRational(exifReader ExifReader) (numerator int, denominator int, err error)
GetRational - WIP
func (Tag) GetRationals ¶
func (tag Tag) GetRationals(exifReader ExifReader) (value []Rational, err error)
GetRationals - WIP
type TagType ¶
type TagType uint8
TagType -
const ( // TypeByte describes an encoded list of bytes. TypeByte TagType = 1 // TypeASCII describes an encoded list of characters that is terminated // with a NUL in its encoded form. TypeASCII TagType = 2 // TypeShort describes an encoded list of shorts. TypeShort TagType = 3 // TypeLong describes an encoded list of longs. TypeLong TagType = 4 // TypeRational describes an encoded list of rationals. TypeRational TagType = 5 // TypeUndefined describes an encoded value that has a complex/non-clearcut // interpretation. TypeUndefined TagType = 7 // TypeSignedLong describes an encoded list of signed longs. TypeSignedLong TagType = 9 // TypeSignedRational describes an encoded list of signed rationals. TypeSignedRational TagType = 10 // TypeASCIINoNul is just a pseudo-type, for our own purposes. TypeASCIINoNul TagType = 0xf0 )
TagTypes defined Copied from dsoprea/go-exif