OPF
SpecDefinition referenceView source

Image Source

An image source in a string shorthand: an 'asset:<id>' reference, an HTTPS URL, a data URI, or a relative path starting with './' or '../' (resolved against the OPF file location).

Metadata

Definition
#/$defs/ImageSource
Form
string
Source
spec/schemas/opf.schema.json

Field index

This definition uses the forms or value constraints below.

Complete definition constraints
Exact schema constraints
{
  "type": "string",
  "pattern": "^(asset:|https://|data:|\\./|\\.\\./)",
  "description": "An image source in a string shorthand: an 'asset:<id>' reference, an HTTPS URL, a data URI, or a relative path starting with './' or '../' (resolved against the OPF file location).",
  "examples": [
    "asset:cover-photo",
    "https://cdn.acme.com/backgrounds/cover.jpg",
    "./images/harbour.jpg"
  ]
}