aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-09-20 12:20:46 +0200
committerDaniel Eklöf <daniel@ekloef.se>2020-09-20 12:21:01 +0200
commitd384b2b902b55f8de9fdbb826175711f4f61547f (patch)
treeefc7460032c23b5935f8e2dd8b3f1b7a4cfa526e /main.c
parent76a79eeac3f49abb048feeb3a8f349db1fc3adbc (diff)
downloadwbg-d384b2b902b55f8de9fdbb826175711f4f61547f.tar.gz
jpeg: initial support for JPEG images, using libjpeg
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index 8e13b5b..8718978 100644
--- a/main.c
+++ b/main.c
@@ -21,6 +21,7 @@
#define LOG_ENABLE_DBG 1
#include "log.h"
#include "png-wbg.h"
+#include "jpg.h"
#include "shm.h"
/* Top-level globals */
@@ -311,7 +312,9 @@ main(int argc, const char *const *argv)
}
const char *image_path = argv[1];
- image = png_load(image_path);
+ image = jpg_load(image_path);
+ if (image == NULL)
+ image = png_load(image_path);
if (image == NULL) {
LOG_ERR("%s: failed to load", image_path);
return EXIT_FAILURE;