From ef1bdc6e4905f0cc3ce7b2ba47a7f62d3a124ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Niemel=C3=A4?= Date: Mon, 15 Sep 2025 18:08:39 +0200 Subject: [PATCH 1/6] Add variant to file references --- Contest_API.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Contest_API.md b/Contest_API.md index 587e120a..e3e47ce3 100644 --- a/Contest_API.md +++ b/Contest_API.md @@ -272,6 +272,7 @@ Properties for file reference objects: | 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. From 9c48eadfa0a475a0a50e86d6292c42da9cab4bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Niemel=C3=A4?= Date: Mon, 15 Sep 2025 18:09:30 +0200 Subject: [PATCH 2/6] clean up table markup --- Contest_API.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Contest_API.md b/Contest_API.md index e3e47ce3..6683f419 100644 --- a/Contest_API.md +++ b/Contest_API.md @@ -264,14 +264,14 @@ 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 From e0fbdb721ce791097eb2f06c8f9f171f0acf3cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Niemel=C3=A4?= Date: Tue, 30 Sep 2025 00:57:12 +0800 Subject: [PATCH 3/6] Align variant on CPF with API --- Contest_Package.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Contest_Package.md b/Contest_Package.md index c7310bd0..ed3a033f 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 From 3a1a7a68d5ded9d91e77386f9009121a5b326868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Niemel=C3=A4?= Date: Tue, 30 Sep 2025 02:44:12 +0800 Subject: [PATCH 4/6] Add dark/light variant example --- Contest_Package.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Contest_Package.md b/Contest_Package.md index ed3a033f..254b967f 100644 --- a/Contest_Package.md +++ b/Contest_Package.md @@ -208,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 From 4d9f6fe4b87574432b330e8c3088fd10db58f7fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Niemel=C3=A4?= Date: Mon, 27 Oct 2025 13:18:51 -0500 Subject: [PATCH 5/6] Fix comments from deboer-tim and johnbrvc --- Contest_Package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Contest_Package.md b/Contest_Package.md index 254b967f..cfb20574 100644 --- a/Contest_Package.md +++ b/Contest_Package.md @@ -77,7 +77,7 @@ The default filename pattern is - `` is the ID of the endpoint object the reference is in. - `` is the property of the object, e.g. `logo`. -- `(.)*` is one or several optional variant tags. +- `(.)*` is zero or more variant tags. - `` is a file extension corresponding to the mime type. For images, the supported file extensions are: @@ -91,7 +91,7 @@ For images, the supported file extensions are: 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. +the value in its `variant` property array. #### Hrefs From d877a7125028afd91a9ae0e5ab665f63412dc877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Niemel=C3=A4?= Date: Mon, 27 Oct 2025 13:21:02 -0500 Subject: [PATCH 6/6] Update Contest_API.md Co-authored-by: Jaap Eldering --- Contest_API.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contest_API.md b/Contest_API.md index 6683f419..89dbd941 100644 --- a/Contest_API.md +++ b/Contest_API.md @@ -272,7 +272,7 @@ Properties for file reference objects: | 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). +| variant | array of string | Intended usage hints (e.g. `light`, `dark` for images). No meaning must be implied or inferred from the order of the elements. The `href` property may be an [absolute or relative URL](https://datatracker.ietf.org/doc/html/rfc3986); relative URLs must be