Fix the last fake images, fix non-square theme icons, throw an error on fake svgs and non-square icons (if public theme)

This commit is contained in:
Pieter Vander Vennet 2022-02-10 23:10:39 +01:00
parent d5378c5bd6
commit db770f2c35
24 changed files with 719 additions and 336 deletions

View file

@ -64,13 +64,9 @@ async function createManifest(layout: LayoutConfig, alreadyWritten: string[]) {
const whiteBackgroundPath = "./assets/generated/theme_"+layout.id+"_white_background.svg"
{
const svgResult = await xml2js.parseStringPromise(readFileSync(icon, "UTF8"))
const svg = svgResult.svg
const svg = await ScriptUtils.ReadSvg(icon)
const width: string = svg.$.width;
const height: string = svg.$.height;
if(width !== height){
console.warn("WARNING: the icon for theme "+layout.id+" is not square. Please square the icon at "+icon+"\n Width = "+width, "height =", height)
}
const builder = new xml2js.Builder();
const withRect = {rect: {"$":{width, height, style: "fill:#ffffff;"}}, ...svg}