@RestController public class ThumbnailController extends Object
| Modifier and Type | Method and Description |
|---|---|
static URI |
getIiifThumbnailUrl(String url,
String width)
All 3 million IIIF newspaper thumbnails have not been processed yet in CRF (see also Jira EA-892) but the
edmPreview field will point to the default IIIF image url, so if we slightly alter that url the IIIF
API will generate a thumbnail in the appropriate size for us on-the-fly
Note that this is a temporary solution until all newspaper thumbnails are processed by CRF.
|
static boolean |
isIiifRecordUrl(String url)
Check if the provided url is a thumbnail hosted on iiif.europeana.eu.
|
org.springframework.http.ResponseEntity<byte[]> |
thumbnailByUrl(String url,
String size,
String type,
org.springframework.web.context.request.WebRequest webRequest,
javax.servlet.http.HttpServletResponse response)
Retrieves image thumbnails.
|
@RequestMapping(value="/v2/thumbnail-by-url.json",
method=GET)
public org.springframework.http.ResponseEntity<byte[]> thumbnailByUrl(@RequestParam(value="uri",required=true)
String url,
@RequestParam(value="size",required=false,defaultValue="w400")
String size,
@RequestParam(value="type",required=false,defaultValue="IMAGE")
String type,
org.springframework.web.context.request.WebRequest webRequest,
javax.servlet.http.HttpServletResponse response)
throws IOException
url - optional, the URL of the media resource of which a thumbnail should be returned. Note that the URL should be encoded.
When no url is provided a default thumbnail will be returnedsize - optional, the size of the thumbnail, can either be w200 (width 200) or w400 (width 400).type - optional, type of the default thumbnail (media image) in case the thumbnail does not exists or no url is provided,
can be: IMAGE, SOUND, VIDEO, TEXT or 3D.webRequest - response - IOExceptionpublic static boolean isIiifRecordUrl(String url)
url - public static URI getIiifThumbnailUrl(String url, String width) throws URISyntaxException
url - width, - desired image widthURISyntaxExceptionCopyright © 2018 Europeana Foundation. All rights reserved.