Index of every page on this site: llms.txt
TypeScript
Schema

Image Schema

Schema.org Image

  • Type: defineImage<T extends Record<string, any>>(input?: ImageObject & T)

Describes an individual image (usually in the context of an embedded media object).

Required properties

  • url or contentUrl string
    The image file URL. Relative URLs become absolute.

Google image metadata

Google's image metadata feature requires contentUrl. Google also accepts url in its place. Unhead copies url to contentUrl when contentUrl is empty.

You must also add at least one of these properties:

  • creator
  • creditText
  • copyrightNotice
  • license

Google recommends the other three properties and acquireLicensePage. Unhead resolves a nested creator as a Person or Organization and makes license URLs absolute.

Defaults

  • @type: ImageObject
  • @id: ${canonicalHost}#/schema/image/{n}
  • inLanguage: inLanguage from resolved page metadata
  • contentUrl: url

Resolves

See Global Resolves for full context.

  • creator resolves as a Person or Organization
  • license and acquireLicensePage become absolute URLs
  • width and height must be provided for either to be included

Examples

Minimal

defineImage({
  url: '/cat.jpg',
})

Types

interface ImageBase extends Thing {
  caption?: string
  height?: number
  width?: number
  inLanguage?: string
  name?: string
  description?: string
  encodingFormat?: string
  creator?: NodeRelations<Identity>
  creditText?: string
  copyrightNotice?: string
  license?: string
  acquireLicensePage?: string
}

type ImageLocation
  = | { url: string, contentUrl?: string }
    | { url?: string, contentUrl: string }

export type ImageSimple = ImageBase & ImageLocation
Did this page help you?