Documentation ¶
Overview ¶
Package heif reads HEIF containers, as found in Apple HEIC/HEVC images. This package does not decode images; it only reads the metadata.
This package is a work in progress and makes no API compatibility promises.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoEXIF = errors.New("heif: no EXIF found")
ErrNoEXIF is returned by File.EXIF when a file does not contain an EXIF item.
var ErrUnknownItem = errors.New("heif: unknown item")
ErrUnknownItem is returned by File.ItemByID for unknown items.
Functions ¶
This section is empty.
Types ¶
type BoxMeta ¶
type BoxMeta struct { FileType *bmff.FileTypeBox Handler *bmff.HandlerBox PrimaryItem *bmff.PrimaryItemBox ItemInfo *bmff.ItemInfoBox Properties *bmff.ItemPropertiesBox ItemLocation *bmff.ItemLocationBox }
BoxMeta contains the low-level BMFF metadata boxes.
func (*BoxMeta) EXIFItemID ¶
EXIFItemID returns the item ID of the EXIF part, or 0 if not found.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File represents a HEIF file.
Methods on File should not be called concurrently.
func (*File) EXIF ¶
EXIF returns the raw EXIF data from the file. The error is ErrNoEXIF if the file did not contain EXIF.
The raw EXIF data can be parsed by the github.com/rwcarlsen/goexif/exif package's Decode function.
func (*File) ItemByID ¶
ItemByID by returns the file's Item of a given ID. If the ID is known, the returned error is ErrUnknownItem.
func (*File) PrimaryItem ¶
PrimaryItem returns the HEIF file's primary item.
type Item ¶
type Item struct { ID uint32 Info *bmff.ItemInfoEntry Location *bmff.ItemLocationBoxEntry // location in file Properties []bmff.Box // contains filtered or unexported fields }
Item represents an item in a HEIF file.
func (*Item) Rotations ¶
Rotations returns the number of 90 degree rotations counter-clockwise that this image should be rendered at, in the range [0,3].
func (*Item) SpatialExtents ¶
SpatialExtents returns the item's spatial extents property values, if present, not correcting from any camera rotation metadata.
func (*Item) VisualDimensions ¶
VisualDimensions returns the item's width and height after correcting for any rotations.