Skip to content

Instantly share code, notes, and snippets.

@pbinkley
Last active November 30, 2023 09:31
Show Gist options
  • Save pbinkley/ef137b619a06f889497bdcf3ac02c6fd to your computer and use it in GitHub Desktop.
Save pbinkley/ef137b619a06f889497bdcf3ac02c6fd to your computer and use it in GitHub Desktop.
Exposing IIIF Images to Google Images

Problem: how to provide Google Images with a full image suitable for display in its search results, without requiring regular users to download a large image?

Solution: link to a suitable full image in a schema.org contentUrl property

Evidence that this works: I've tried it in a low-traffic hobby site, using static IIIF images. E.g. for this image, the schema.org entry looks like this:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "ImageObject",
  "url": "https://www.wallandbinkley.com/wheatley/album-v-b/V.B.13VA1.html",
  "author": "Peter Binkley",
  "representativeOfPage": true,
  "contentLocation": "Gravois Mills, Missouri, USA",
  "contentUrl": "https://www.wallandbinkley.com/wheatley/tiles/images/V.B.13VA1-1/full/full/0/default.jpg",
  "thumbnail": "https://www.wallandbinkley.com/wheatley/tiles/images/V.B.13VA1-1/full/250,/0/default.jpg",
  "name": "V.B.13VA1"
}
</script>

Note that the full/full/0/default.jpg image url is only exposed in this schema.org block.

A Google Images search for site:wallandbinkley.com wheatley retrieves this image, and the full image that it displays is drawn from the url in the contentUrl property (as can be confirmed by clicking on the image in the Google Image search results to enlarge it, and then right-clicking on it and viewing it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment