Documentation ¶
Index ¶
Constants ¶
View Source
const UnknownPrefix = "UnknownTag_"
UnknownPrefix is used as prefix for unknown tags.
Variables ¶
View Source
var ErrInvalidFormat = fmt.Errorf("imagemeta: invalid format")
ErrInvalidFormat is returned when the format is not recognized.
View Source
var ( // ErrStopWalking is a sentinel error to signal that the walk should stop. ErrStopWalking = fmt.Errorf("stop walking") )
Functions ¶
Types ¶
type HandleTagFunc ¶
HandleTagFunc is the function that is called for each tag.
type ImageFormat ¶
type ImageFormat int
const ( // ImageFormatAuto signals that the image format should be detected automatically (not implemented yet). ImageFormatAuto ImageFormat = iota // ImageFormatJPEG is the JPEG image format. ImageFormatJPEG // ImageFormatTIFF is the TIFF image format. ImageFormatTIFF // ImageFormatPNG is the PNG image format. ImageFormatPNG // ImageFormatWebP is the WebP image format. ImageFormatWebP )
func (ImageFormat) String ¶
func (i ImageFormat) String() string
type Options ¶
type Options struct { // The Reader (typically a *os.File) to read image metadata from. R Reader // The image format in R. ImageFormat ImageFormat // The function to call for each tag. HandleTag HandleTagFunc // The default XMP handler is currently very simple: // It decodes the RDF.Description.Attrs using Go's xml package and passes each tag to HandleTag. // If HandleXMP is set, the decoder will call this function for each XMP packet instead. // Note that r must be read completely. HandleXMP func(r io.Reader) error // If set, the decoder will only read the given tag sources. // Note that this is a bitmask and you may send multiple sources at once. Sources TagSource }
type Reader ¶
type Reader interface { io.ReadSeeker io.ReaderAt }
Reader is the interface that wraps the basic Read and Seek methods.
type TagInfo ¶
type TagInfo struct { // The tag source. Source TagSource // The tag name. Tag string // The tag namespace, if any (currently only set for XMP tags.) Namespace string // The tag value. Value any }
TagInfo contains information about a tag.
type TagSource ¶
type TagSource uint32
TagSource is a bitmask and you may send multiple sources at once.
Click to show internal directories.
Click to hide internal directories.