summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Manley <william.manley@youview.com>2012-06-25 20:37:01 +0100
committerThiago Santos <ts.santos@osg.sisa.samsung.com>2014-07-28 14:18:02 -0300
commit1b5483eef98928d000acea579d4e68a5374557f1 (patch)
treec7b46f8478c19044bb35bf3e10e0b9fa6d8bd23e
parent88cb33a1dce12ab6ae847dd417effc00d6954688 (diff)
templatematch: Produce a warning message if we can't load a template image
-rw-r--r--ext/opencv/gsttemplatematch.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/opencv/gsttemplatematch.c b/ext/opencv/gsttemplatematch.c
index 36163e02f..bfd0be83e 100644
--- a/ext/opencv/gsttemplatematch.c
+++ b/ext/opencv/gsttemplatematch.c
@@ -63,6 +63,7 @@
#include <gst/gst.h>
+#include "../../gst-libs/gst/gst-i18n-plugin.h"
#include "gstopencvutils.h"
#include "gsttemplatematch.h"
@@ -432,8 +433,13 @@ gst_template_match_load_template (GstTemplateMatch * filter, gchar * template)
if (template) {
newTemplateImage = cvLoadImage (template, CV_LOAD_IMAGE_COLOR);
if (!newTemplateImage) {
- GST_WARNING ("Couldn't load template image: %s. error: %s",
- template, g_strerror (errno));
+ /* Unfortunately OpenCV doesn't seem to provide any way of finding out
+ why the image load failed, so we can't be more specific than FAILED: */
+ GST_ELEMENT_WARNING (filter, RESOURCE, FAILED,
+ (_("OpenCV failed to load template image")),
+ ("While attempting to load template '%s'", template));
+ g_free (template);
+ template = NULL;
}
}