Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v2.6.1330

Pre-release
Pre-release

Choose a tag to compare

@icpctools-bot icpctools-bot released this 07 Nov 13:28
Improve light/dark lookup and related image generator

This fixes three related problems I found while testing different scenarios with
light/dark/untagged logos:

1. Improved matching for two scenarios:
 - If you have 3 filerefs (light, dark, no tag) and request without a tag, you should
   get the untagged one.
 - If you have 2 filerefs (light, no tag) and request the dark tag, you should get the
   one with no tag.

These are edge cases that can sometimes work depending on what  order files are loaded
in, but the changes in ContestObject make sure it works predictably. Files are essentially
in three groups: things that match exactly, things that don't match but don't have a
conflicting/opposite tag, and everything else (i.e. conflicting tags). We look for
files in the first non-empty of these sets.

2. The ImageGenerator produces a contest logo/banner preview and an org logo preview,
each with images on a dark, grey, and white background. Prior to this it showed the
dark logo on the first two backgrounds and light on the white background. Now it tries
to find the best dark, no tag, and light logos respectively, which helps you understand
if you have all three or any combination which are likely to be loaded.

3. If you point at a contest location with no contest.json or .yaml (as we do with the
/shared folder for WFs), there is no 'contest', so we never try to load the contest logo
or banner. As a result, images/contest-preview.png is empty. This changes the disk
contest model to look for these resources when there is no contest.