improve the way boot logo source image errors are handled to address issue #1077

10.4.x-maintenance
Kiripolszky Károly 2018-07-03 00:38:56 +02:00
parent 192e886f30
commit 8322e86b57
3 changed files with 11 additions and 4 deletions

View File

@ -3120,7 +3120,7 @@
"message": "Invalid image size: {{width}}×{{height}} (expected $t(logoWidthPx)×$t(logoHeightPx))"
},
"osdSetupCustomLogoColorMapError": {
"message": "The image contains an invalid color palette (only green, black and white are allowed)"
"message": "The image contains an invalid pixel: rgb({{valueR}}, {{valueG}}, {{valueB}}) at coordinates {{posX}}×{{posY}}"
},
"osdSetupUploadFont": {
"message": "Upload Font"

View File

@ -336,7 +336,7 @@
#font-logo-preview-container {
background:rgba(0, 255, 0, 0.4);
margin-bottom: 10px;
width: 50%;
width: 45%;
float: left;
}
@ -347,6 +347,7 @@
}
#font-logo-info {
width: 45%;
margin-left: 18px;
font-size: 125%;
line-height: 150%;

View File

@ -80,7 +80,13 @@ LogoManager.init = function (font, logoStartIndex) {
var rgbPixel = ctx.getImageData(x, y, 1, 1).data.slice(0, 3),
colorKey = rgbPixel.join("-");
if (!this.constants.MCM_COLORMAP[colorKey]) {
GUI.log(i18n.getMessage("osdSetupCustomLogoColorMapError"));
GUI.log(i18n.getMessage("osdSetupCustomLogoColorMapError", {
valueR: rgbPixel[0],
valueG: rgbPixel[1],
valueB: rgbPixel[2],
posX: x,
posY: y,
}));
return false;
}
}
@ -162,7 +168,7 @@ LogoManager.openImage = function () {
this.showConstraintSatisfied(constraint);
} else {
this.showConstraintNotSatisfied(constraint);
reject();
reject("Boot logo image constraint violation");
return;
}
}