image

package
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The maximum width of the artwork to extract. If the image is larger than this, it will be resized,
	// but the aspect ratio will be preserved. If the image is smaller than this, it will be returned as is,
	// but potentially converted to a jpeg.
	MaxWidth = 640

	// Formats that should be encoded as PNG when resized or re-encoded. All other formats are encoded as JPEG.
	PNGFormats = "png,gif,bmp,tiff"
)

Variables

This section is empty.

Functions

func ExtractArtwork

func ExtractArtwork(data []byte, key string) (gomedia.Metadata, error)

ExtractArtwork decodes image data and returns it as a gomedia.Metadata entry under key, resized to at most MaxWidth (preserving aspect ratio) and re-encoded as PNG or JPEG as appropriate. Already-jpeg/png images near the target width are returned unchanged rather than re-encoded. It is shared by the generic image/* artwork handler, for RAW files' embedded thumbnail, and by metadata/audio for embedded cover art.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL