From 6e7de538a716942bd248f7a294b80951d2d87881 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sat, 14 May 2022 20:11:59 +0200 Subject: [PATCH] resize image sizes; add check for images that are too small --- Models/ThemeConfig/Conversion/Validation.ts | 12 ++++ assets/layers/binocular/telescope.svg | 15 ++--- assets/layers/dogpark/dog-park.svg | 61 +++++++++---------- assets/layers/recycling/recycling-14.svg | 27 ++++---- assets/themes/bicycle_rental/logo.svg | 21 ++++--- .../mapcomplete-changes.json | 59 +++++------------- assets/themes/notes/logo.svg | 26 ++++---- 7 files changed, 102 insertions(+), 119 deletions(-) diff --git a/Models/ThemeConfig/Conversion/Validation.ts b/Models/ThemeConfig/Conversion/Validation.ts index b0c121953..96f08f33b 100644 --- a/Models/ThemeConfig/Conversion/Validation.ts +++ b/Models/ThemeConfig/Conversion/Validation.ts @@ -121,6 +121,18 @@ class ValidateTheme extends DesugaringStep { ` Width = ${width} height = ${height}`; (json.hideFromOverview ? warnings : errors).push(e) } + + const w = parseInt(width); + const h = parseInt(height) + if(w < 370 || h < 370){ + const e : string = [ + `the icon for theme ${json.id} is too small. Please rescale the icon at ${json.icon}`, + `Even though an SVG is 'infinitely scaleable', the icon should be dimensioned bigger. One of the build steps of the theme does convert the image to a PNG (to serve as PWA-icon) and having a small dimension will cause blurry images.`, + ` Width = ${width} height = ${height}; we recommend a size of at least 500px * 500px and to use a square aspect ratio.`, + ].join("\n"); + (json.hideFromOverview ? warnings : errors).push(e) + } + }) } catch (e) { console.error("Could not read " + json.icon + " due to " + e) diff --git a/assets/layers/binocular/telescope.svg b/assets/layers/binocular/telescope.svg index 1bbf1b545..fdbd28d91 100644 --- a/assets/layers/binocular/telescope.svg +++ b/assets/layers/binocular/telescope.svg @@ -1,12 +1,12 @@ + inkscape:cy="272.04444" + inkscape:current-layer="svg9" + width="500px" /> + transform="matrix(1.3399859,0,0,1.3399859,-0.73371278,26.823214)"> image/svg+xml + style="display:inline"> diff --git a/assets/layers/recycling/recycling-14.svg b/assets/layers/recycling/recycling-14.svg index 9778d136c..ff05c8c74 100644 --- a/assets/layers/recycling/recycling-14.svg +++ b/assets/layers/recycling/recycling-14.svg @@ -3,12 +3,12 @@ + inkscape:zoom="1.3871348" + inkscape:cx="252.31866" + inkscape:cy="292.68965" + inkscape:current-layer="svg2" + width="500px" /> @@ -44,14 +45,14 @@