diff --git a/templates/icon.png b/templates/icon.png new file mode 100644 index 00000000..047b6e5f Binary files /dev/null and b/templates/icon.png differ diff --git a/templates/stackyard.xml b/templates/stackyard.xml index 5f4b65f6..891f1e35 100644 --- a/templates/stackyard.xml +++ b/templates/stackyard.xml @@ -14,7 +14,7 @@ Tools:Utilities http://[IP]:[PORT:80] https://raw.githubusercontent.com/SandObserver/Stackyard/main/templates/stackyard.xml - https://raw.githubusercontent.com/SandObserver/Stackyard/main/templates/icon.svg + https://raw.githubusercontent.com/SandObserver/Stackyard/main/templates/icon.png https://raw.githubusercontent.com/SandObserver/Stackyard/main/docs/screenshot.png https://raw.githubusercontent.com/SandObserver/Stackyard/main/docs/screenshot-general.png https://raw.githubusercontent.com/SandObserver/Stackyard/main/docs/screenshot-appearance.png diff --git a/test/repo/ca-template.test.js b/test/repo/ca-template.test.js index a27a13f8..26a637ba 100644 --- a/test/repo/ca-template.test.js +++ b/test/repo/ca-template.test.js @@ -57,7 +57,7 @@ test('config and icon storage are both mapped, or an update wipes them', () => { test('every referenced asset exists in the repo', () => { const assets = { - [tag(template, 'Icon')]: 'templates/icon.svg', + [tag(template, 'Icon')]: 'templates/icon.png', [tag(template, 'Screenshot')]: 'docs/screenshot.png', }; for (const [url, file] of Object.entries(assets)) { @@ -66,6 +66,18 @@ test('every referenced asset exists in the repo', () => { } }); +/* Unraid saves the template icon as -icon.png whatever its format. An SVG + saved under that name draws blank on the Docker tab and the Dashboard. */ +test('the template icon is a PNG and matches the 512 px favicon', () => { + const icon = fs.readFileSync(path.join(ROOT, 'templates', 'icon.png')); + const signature = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]); + assert.deepEqual(icon.subarray(0, 8), signature, 'templates/icon.png is not a PNG'); + assert.ok( + icon.equals(fs.readFileSync(path.join(ROOT, 'ui', 'icons', 'favicon-512.png'))), + 'templates/icon.png differs from ui/icons/favicon-512.png', + ); +}); + test('the legacy light and dark icons ship alongside the tile icon', () => { for (const f of ['templates/icon.svg', 'templates/icon-light.svg', 'templates/icon-dark.svg']) { assert.ok(fs.existsSync(path.join(ROOT, f)), `${f} is missing`);