Skip to content
Client
Server

Reference / @open-music-sdk/util-artwork / tArtworkOptions

Interface: tArtworkOptions ​

Defined in: artwork.ts:30

What artworkUrl takes beside the artwork and the width. Invalid values throw a TypeError.

Extended by ​

Properties ​

crop? ​

ts
readonly optional crop?: string;

Defined in: artwork.ts:45

Apple's code for how the image is cut to the box, such as "bb", the whole image fitted inside it, or "sr", the box filled. Default: the one the template names, or "bb" where it leaves that open as {c}.

Apple does not document the codes, so any code of the right shape is taken, its case kept: letters and digits, with single dots or hyphens between them, 32 characters at most, the dots and hyphens included, as in bb-60 or SC.DN01, which comes with some editorial artwork. A code that is neither bb nor cc, with or without a hyphen and more after it, is taken to fill the box exactly, as every other code tried did; if yours does not, lay the image out yourself.


format? ​

ts
readonly optional format?: "jpg" | "jpeg" | "png" | "webp" | "heic" | "heif";

Defined in: artwork.ts:34

The file format. Default: the one the template names, or "jpg" where it leaves that open as {f}.


height? ​

ts
readonly optional height?: number;

Defined in: artwork.ts:32

Height in CSS pixels. Default: the height that keeps the artwork's own shape at width, or width where its shape is unknown.


hosts? ​

ts
readonly optional hosts?: readonly string[];

Defined in: artwork.ts:51

The hosts artwork may come from, such as ["mzstatic.com"], where Apple serves its catalog artwork. With this, a URL that is not https on one of them or on a subdomain of one, with no port and no credentials, is a TypeError and nothing is returned. Default: where the URL points is not checked at all.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.