PICTURE is block type 6. It holds a picture, usually the cover, and a stream may have several.
Layout
Lengths and numbers are big-endian, 32 bits each.
| Bytes | Field | Meaning |
|---|---|---|
| 4 | Picture type | See below |
| 4 | MIME type length | |
| n | MIME type | A media type (RFC 2046) such as image/png, or --> for a link. Printable ASCII only, 20 to 7E |
| 4 | Description length | |
| n | Description | UTF-8 |
| 4 | Width | In pixels |
| 4 | Height | In pixels |
| 4 | Colour depth | Bits per pixel |
| 4 | Indexed colours | The number of colours for an indexed picture, otherwise 0 |
| 4 | Data length | |
| n | Data | The picture file, or the link |
Width, height, depth and colour count are for choosing among pictures without decoding them; they do not affect how a picture is decoded, and 0 is used when they are not known.
The whole block, picture included, is at most 16 MiB, the most a metadata block header’s 24-bit length can describe, although each of the three 4-byte length fields could code up to 4 GiB.
When the MIME type is -->, the data is a URI as described in RFC 3986
instead of the picture (RFC 9639 section 8.8). RFC 9639 section 8.8 says the URI can be
in absolute or relative form, and a relative one is related to the URI of the FLAC
content being processed.
Applications MUST obtain explicit user approval to retrieve an image through a remote protocol, and to retrieve a local image that is not in the same directory as the FLAC file (sections 8.8 and 11). Section 11 adds that approval is needed for each retrieval individually, and that because relative URIs are permitted, applications MUST guard against directory traversal. Applications that support linked images MUST handle an unavailable URI gracefully and MAY report it; they MAY reject any URI, particularly for security or privacy reasons.
Picture types
| Value | Type |
|---|---|
| 0 | Other |
| 1 | PNG file icon of 32×32 pixels. At most one |
| 2 | General file icon. At most one |
| 3 | Front cover |
| 4 | Back cover |
| 5 | Liner notes page |
| 6 | Media label (for example a CD, vinyl or cassette label) |
| 7 | Lead artist, lead performer or soloist |
| 8 | Artist or performer |
| 9 | Conductor |
| 10 | Band or orchestra |
| 11 | Composer |
| 12 | Lyricist or text writer |
| 13 | Recording location |
| 14 | During recording |
| 15 | During performance |
| 16 | Movie or video screen capture |
| 17 | A bright coloured fish, a value carried over from ID3v2 |
| 18 | Illustration |
| 19 | Band or artist logotype |
| 20 | Publisher or studio logotype |
Other values are reserved. Type 1 must be a PNG.