Getty Images
The getty module lets editors search and import licensed images from Getty Images through Brightspot's federated search.
Dependencies
Depends on db-http and the official Getty Images API SDK (com.gettyimagesapi-sdk), which wraps Getty's search, detail, and downloads APIs.
Installation
- Maven
- Gradle
- Gradle (Kotlin DSL)
<!-- Requires Brightspot 5.0 or later. -->
<dependency>
<groupId>com.brightspot.dbhttp</groupId>
<artifactId>getty</artifactId>
<version>1.0.0</version>
</dependency>
// Requires Brightspot 5.0 or later.
implementation 'com.brightspot.dbhttp:getty:1.0.0'
// Requires Brightspot 5.0 or later.
implementation("com.brightspot.dbhttp:getty:1.0.0")
API reference
com.psddev.getty.GettyDatabase
Extends HttpDatabase. Translates the query's keyword, filters, and sort order into Getty's search API parameters, and requests full-resolution downloads through Getty's Downloads API when licensing allows it.
com.psddev.getty.GettyImage
Extends ExternalItem.
| Field | Type | Description |
|---|---|---|
title | String | The image's title. |
gettyId | String | The Getty Images Id. |
previewUrl | String | A watermarked preview image URL. |
caption | String | The image caption. |
artist | String | The artist credited for the image. |
credit | String | The image credit line. |
editorialSource | String | The editorial source name. |
copyright | String | The image's copyright notice. |
dateSubmitted | Date | When the image was submitted to Getty. |
dateCreated | Date | When the image was created. |
keywords | Set<String> | Getty keywords assigned to the image. |
ageOfPeople | List<String> | Filterable age-of-people categories depicted in the image. |
specificPeople | List<String> | Filterable named people depicted in the image. |
ethnicity | List<String> | Filterable ethnicity categories depicted in the image. |
numberOfPeople | List<String> | Filterable number-of-people categories depicted in the image. |
orientation | List<String> | Filterable image orientation categories. |
color | String | The image's dominant color, filterable with a color picker. |
Sort order is set through the GettyImageSort enum: BEST_MATCH, MOST_POPULAR, or NEWEST.
Configuration
Credentials are stored on com.psddev.getty.GettyApiClient (name, apiKey, apiSecret), referenced from GettySettings, a Modification<SiteSettings> shown under Site Settings > Integrations > Getty. GettySettings also has a downloadFullImages toggle controlling whether the module attempts a full-resolution download or falls back to the preview image.
Extending the plugin
The module doesn't ship a content type for imported images. To let editors create one from search results, define a content type and extend ExternalItemConverter<GettyImage, T> to convert the external item into it on import, downloading the image with GettyImage#generateStorageItemFromUrl.