summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Mueller <muelli@cryptobitch.de>2019-09-13 13:20:39 +0200
committerRichard Hughes <richard@hughsie.com>2019-09-13 14:02:01 +0100
commitd9270c52bffde6ebd4fc3e3b4e0d34f802b920db (patch)
treeceaa5ceef7700eb841367b9b7b041f4934cae77e
parent15947d3d664653b753a366de8ebbc2dfe3c28f83 (diff)
downloadappstream-glib-d9270c52bffde6ebd4fc3e3b4e0d34f802b920db.tar.gz
Log expected and actual screenshot dimensions when failing
Sometimes it is quite helpful to see the values the validator objects. Especially when it is hard to comprehend why the validation fails if one has, say, an image in a stale cache which the validator does not have.
-rw-r--r--libappstream-glib/as-app-validate.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c
index 0f9b2cf..ccac4e2 100644
--- a/libappstream-glib/as-app-validate.c
+++ b/libappstream-glib/as-app-validate.c
@@ -520,8 +520,8 @@ ai_app_validate_image_check (AsImage *im, AsAppValidateHelper *helper)
as_image_get_width (im) != screenshot_width) {
ai_app_validate_add (helper,
AS_PROBLEM_KIND_ATTRIBUTE_INVALID,
- "<screenshot> width did not match specified [%s]",
- url);
+ "<screenshot> width (%u) did not match specified (%u) [%s]",
+ as_image_get_width (im), screenshot_width, url);
}
/* check height matches */
@@ -529,16 +529,16 @@ ai_app_validate_image_check (AsImage *im, AsAppValidateHelper *helper)
as_image_get_height (im) != screenshot_height) {
ai_app_validate_add (helper,
AS_PROBLEM_KIND_ATTRIBUTE_INVALID,
- "<screenshot> height did not match specified [%s]",
- url);
+ "<screenshot> height (%u) did not match specified (%u) [%s]",
+ as_image_get_height (im), screenshot_height, url);
}
/* check size is reasonable */
if (screenshot_width < ss_size_width_min) {
ai_app_validate_add (helper,
AS_PROBLEM_KIND_ATTRIBUTE_INVALID,
- "<screenshot> width too small [%s] minimum is %upx",
- url, ss_size_width_min);
+ "<screenshot> width (%u) too small [%s] minimum is %upx",
+ screenshot_width, url, ss_size_width_min);
}
if (screenshot_height < ss_size_height_min) {
ai_app_validate_add (helper,