From 6163d7638414680e047e8a77039aa640e3cb06ff Mon Sep 17 00:00:00 2001 From: Radek Hvizdos Date: Thu, 9 Feb 2017 12:43:20 +0100 Subject: [PATCH] Fallback to jpeg if webp was selected in the config file, but the support for it was not compiled in --- motion.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/motion.c b/motion.c index 34cce837..659056d8 100644 --- a/motion.c +++ b/motion.c @@ -850,8 +850,15 @@ static int motion_init(struct context *cnt) /* Set output picture type */ if (!strcmp(cnt->conf.picture_type, "ppm")) cnt->imgs.picture_type = IMAGE_TYPE_PPM; - else if (!strcmp(cnt->conf.picture_type, "webp")) + else if (!strcmp(cnt->conf.picture_type, "webp")) { +#ifdef HAVE_WEBP cnt->imgs.picture_type = IMAGE_TYPE_WEBP; +#else + /* Fallback to jpeg if webp was selected in the config file, but the support for it was not compiled in */ + MOTION_LOG(WRN, TYPE_ALL, NO_ERRNO, "%s: webp image format is not available, failing back to jpeg"); + cnt->imgs.picture_type = IMAGE_TYPE_JPEG; +#endif /* HAVE_WEBP */ + } else cnt->imgs.picture_type = IMAGE_TYPE_JPEG;