diff --git a/Contest_API.md b/Contest_API.md index 587e120..6683f41 100644 --- a/Contest_API.md +++ b/Contest_API.md @@ -264,14 +264,15 @@ Properties for geographic location objects: Properties for file reference objects: -| Name | Type | Description -| -------- | --------- | ----------- -| href | string | URL where the resource can be found. Relative URLs are relative to the `baseurl`. Must point to a file of intended mime-type. Resource must be accessible using the exact same (possibly none) authentication as the call that returned this data. (Note: this is actually optional inside a [Contest Package](contest_package)). -| filename | string | POSIX compliant filename. Filenames must be unique within the endpoint object where they are used. I.e. an organization can have (multiple) `logo` and `country_flag` file references, they must all have a different filename, but different organizations may have files with the same filename. -| hash | string ? | MD5 hash of the file referenced. -| mime | string | Mime type of resource. -| width | integer ? | Width of the image. Required for files with mime type image/\*. -| height | integer ? | Height of the image. Required for files with mime type image/\*. +| Name | Type | Description +| -------- | --------------- | ----------- +| href | string | URL where the resource can be found. Relative URLs are relative to the `baseurl`. Must point to a file of intended mime-type. Resource must be accessible using the exact same (possibly none) authentication as the call that returned this data. (Note: this is actually optional inside a [Contest Package](contest_package)). +| filename | string | POSIX compliant filename. Filenames must be unique within the endpoint object where they are used. I.e. an organization can have (multiple) `logo` and `country_flag` file references, they must all have a different filename, but different organizations may have files with the same filename. +| hash | string ? | MD5 hash of the file referenced. +| mime | string | Mime type of resource. +| width | integer ? | Width of the image. Required for files with mime type image/\*. +| height | integer ? | Height of the image. Required for files with mime type image/\*. +| variant | array of string | Intended usage hints (e.g. `light`, `dark` for images). The `href` property may be an [absolute or relative URL](https://datatracker.ietf.org/doc/html/rfc3986); relative URLs must be @@ -292,6 +293,13 @@ the values of `width` and `height` should be the viewport width and height in pi when possible, but otherwise the actual values don't matter as long as they are positive and represent the correct aspect ratio. +Known values of variant include: + +- `light`: an image intended for use on white or light backgrounds. +- `dark`: an image intended for use on black or dark backgrounds. + +An image may list both values if it is suitable for multiple contexts. + If implementing support for uploading files pointed to by resource links, substitute the href property with a data property with a base64 encoded string of the associated file contents as the value. diff --git a/Contest_Package.md b/Contest_Package.md index c7310bd..254b967 100644 --- a/Contest_Package.md +++ b/Contest_Package.md @@ -73,12 +73,11 @@ filename pattern must be loaded in addition to any file references found in the json files. The default filename pattern is -`//(.variant).`, where: +`//(.)*.`, where: - `` is the ID of the endpoint object the reference is in. - `` is the property of the object, e.g. `logo`. -- `(.)` is an optional variant. Must be used when there are - multiple files to avoid collisions. +- `(.)*` is one or several optional variant tags. - `` is a file extension corresponding to the mime type. For images, the supported file extensions are: @@ -89,8 +88,10 @@ For images, the supported file extensions are: | image/jpeg | jpg, jpeg | image/svg+xml | svg -For images, the variant should be `.x`, where W and H are the width and -height of the image in pixels, e.g. logo.56x54.png. +For images, a variant of `.x`, is interpreted as the file reference object +having the `width` property set to `` and the `height` property set to +``. Every other variant is interpreted as the file reference object having +the value its `variant` property array. #### Hrefs @@ -207,6 +208,10 @@ organizations/kth.se/logo.56x56.png organizations/kth.se/logo.160x160.png organizations/baylor.edu/logo.56x56.png organizations/baylor.edu/logo.160x160.png +organizations/tudelft.nl/logo.dark.56x56.png +organizations/tudelft.nl/logo.light.56x56.png +organizations/tudelft.nl/logo.dark.160x160.png +organizations/tudelft.nl/logo.light.160x160.png ... teams.json teams/team-001/photo.jpg