Documentation
¶
Index ¶
- Constants
- type EXIF
- type IFD
- type MakerNote
- type Tag
- func (t *Tag) Any() any
- func (t *Tag) Bytes() []byte
- func (t *Tag) Components() uint
- func (t *Tag) Format() libexif.Format
- func (t *Tag) IFD() IFD
- func (t *Tag) Image() image.Image
- func (t *Tag) Key() string
- func (t *Tag) MarshalJSON() ([]byte, error)
- func (t *Tag) NS() string
- func (t *Tag) Name() string
- func (t *Tag) String() string
- func (t *Tag) Tag() TagType
- func (t *Tag) Value() string
- type TagType
Constants ¶
const ( TIFFNamespace = "tiff" EXIFNamespace = "exif" )
The namespaces of the tags of EXIF metadata, which are those of their XMP schemas: tiff for the tags of the image, from IFD0 and IFD1, and exif for those of the photo, its GPS position, and interoperability. This file doesn't need cgo, so they're defined without it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EXIF ¶
type EXIF struct {
// contains filtered or unexported fields
}
func Parse ¶
Parse returns the EXIF data in the data, which is a JPEG image, or EXIF data, or the EXIF data of a HEIF image, which is after four bytes of the offset of its TIFF header, or an error when there are no tags in it
func (*EXIF) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*EXIF) Orientation ¶
Orientation returns the orientation of the image, from 1 to 8, as EXIF defines it, or 1 when it doesn't have one (see tiff.Orientation)
func (*EXIF) Thumbnail ¶
Thumbnail returns the thumbnail which is embedded in the EXIF data, which is usually a small JPEG image, such as 160x120, or nil when there isn't one (see tiff.Thumbnail). libexif reads the thumbnail, but doesn't expose it, or keep the tags of where it is, so they're read from the data.
type MakerNote ¶
type MakerNote struct {
// contains filtered or unexported fields
}
func (*MakerNote) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
func (*Tag) Any ¶
Any returns the tag's data decoded into an appropriate Go type (implements metadata.Metadata). For single-component tags: uint8, int8, uint16, int16, uint32, int32, rational.Rational (signed or unsigned), float32, float64, or string (ASCII). For multi-component tags the corresponding slice type is returned. UNDEFINED format is returned as []byte.
func (*Tag) Components ¶
Components returns the number of values in the tag's data array.
func (*Tag) Key ¶
Key returns the tag name, such as "DateTimeOriginal" (implements metadata.Metadata).
func (*Tag) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Tag) NS ¶
NS returns "tiff" for IFD0/IFD1 tags and "exif" for EXIF/GPS/Interop tags (implements metadata.Metadata). The namespace aligns with XMP namespace conventions so cross-source lookups work uniformly.