Documentation ¶
Index ¶
Constants ¶
View Source
const (
// MIMEURL is the MIME string indicating that imgData is a URL pointing to the image
MIMEURL = "-->"
)
Variables ¶
View Source
var ( // ErrorNotPictureMetadataBlock is returned if the metadata provided is not a picture block. ErrorNotPictureMetadataBlock = errors.New("Not a picture metadata block") // ErrorUnsupportedMIME is returned if the provided image MIME type is unsupported. ErrorUnsupportedMIME = errors.New("Unsupported MIME") )
Functions ¶
This section is empty.
Types ¶
type MetadataBlockPicture ¶
type MetadataBlockPicture struct { PictureType PictureType MIME string Description string Width uint32 Height uint32 ColorDepth uint32 IndexedColorCount uint32 ImageData []byte }
MetadataBlockPicture represents a picture metadata block
func NewFromImageData ¶
func NewFromImageData(pictype PictureType, description string, imgdata []byte, mime string) (*MetadataBlockPicture, error)
NewFromImageData generates a MetadataBlockPicture from image data, returns an error if the picture data connot be parsed
func ParseFromMetaDataBlock ¶
func ParseFromMetaDataBlock(meta flac.MetaDataBlock) (*MetadataBlockPicture, error)
ParseFromMetaDataBlock parses an existing picture MetaDataBlock
func (*MetadataBlockPicture) Marshal ¶
func (c *MetadataBlockPicture) Marshal() flac.MetaDataBlock
Marshal encodes the PictureBlock to a standard FLAC MetaDataBlock to be accepted by go-flac
func (*MetadataBlockPicture) ParsePicture ¶
func (c *MetadataBlockPicture) ParsePicture() error
ParsePicture decodes the image and inflates the Width, Height, ColorDepth, IndexedColorCount fields. This is called automatically by NewFromImageData
type PictureType ¶
type PictureType uint32
PictureType defines the type of this image
const ( PictureTypeOther PictureType = iota PictureTypeFileIcon PictureTypeOtherIcon PictureTypeFrontCover PictureTypeBackCover PictureTypeLeaflet PictureTypeMedia PictureTypeLeadArtist PictureTypeArtist PictureTypeConductor PictureTypeBand PictureTypeComposer PictureTypeLyricist PictureTypeRecordingLocation PictureTypeDuringRecording PictureTypeDuringPerformance PictureTypeScreenCapture PictureTypeBrightColouredFish PictureTypeIllustration PictureTypeBandArtistLogotype PictureTypePublisherStudioLogotype )
Click to show internal directories.
Click to hide internal directories.